"Parameters" : { "InstanceTypeParameter" : { "Description" : "Enter t2.micro, m1.small, or m1.large. Default is t2.micro.", "Type" : "String", "Default" : "t2.micro", "AllowedValues" : ["t2.micro", "m1.small", "m1.large"] } } YAML Parameters: InstanceTypeParameter: Descr...
Parameters是模板里面的可选字段。利用参数,你能够在每次创建或更新堆栈时将自定义值输入模板。 例如可以让用户自己选择EC2的密钥对,密钥对可以设置默认值。设置Web服务器的端口,端口值只能在AllowedValues中选择,后续安全组和输出都可以调用这个端口信息。 Parameters: myKeyPair: Description: Amazon EC2 Key Pair Type...
除非提供有其他值,否则这是 AWS CloudFormation 用于预置堆栈的值。 "Parameters" : { "InstanceTypeParameter" : { "Type" : "String", "Default" : "t2.micro", "AllowedValues" : ["t2.micro", "m1.small", "m1.large"], "Description" : "Enter t2.micro, m1.small, or m1.large. Default ...
Parameters: Environment: Type: String AllowedValues: - production - development Conditions: IsProduction: !Equals [!Ref Environment, production] Resources: MyEC2Instance: Type: "AWS::EC2::Instance" Properties: InstanceType: !If [IsProduction, "t3.large", "t2.micro"] ImageId: "ami-12345678" ...
{ "Parameters": { "InstanceType" : { "Description" : "WebServer EC2 instance type", "Type" : "String", "Default" : "t2.small", "AllowedValues" : [ "t1.micro", "t2.nano", "t2.micro", "t2.small", "t2.medium", "t2.large", "m1.small", "...
Parameters: Environment: Type: String AllowedValues: [dev, prod] Default: dev Conditions: CreateProdResources: !Equals [!Ref Environment, prod] Resources: MyResource: Type: AWS::EC2::Instance Condition: CreateProdResources Properties: ...
importcloudform,{Fn,Refs,EC2,StringParameter,ResourceTag}from"cloudform"exportdefaultcloudform({Description:'My template',Parameters:{DeployEnv:newStringParameter({Description:'Deploy environment name',AllowedValues:['stage','production']})},Mappings:{DeploymentConfig:{stage:{InstanceType:'t2.small'},...
AWS CloudFormation gives you several ways to perform parameter validation. For example, you can specify AllowedValues or a Default, or you can assign Types. For more information on validating parameters, see the documentation. Often, developers […]...
AWS CloudFormation gives you several ways to perform parameter validation. For example, you can specify AllowedValues or a Default, or you can assign Types. For more information on validating parameters, see the documentation. Often, developers […]...
Reference these parameters in your guard rule file (e.g.,security_groups.guard): let groups = Resources.*[ Type == 'AWS::EC2::SecurityGroup' ] let permitted_sgs = NETWORK.allowed_security_groups let permitted_pls = NETWORK.allowed_prefix_lists rule check_permitted_security_groups_or_prefix...