按照模板中提到的顺序排列参数

sha*_*nuo 1 aws-cloudformation aws-cloudformation-custom-resource

当您在控制台中创建堆栈时,控制台会按输入参数的逻辑 ID 按字母顺序列出输入参数。有一种方法可以使用界面自定义订单。

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-interface.html

但是有什么办法可以按照模板中提到的参数来排序吗?

Str*_*tch 7

使用AWS::CloudFormation::Interface它可以让您设置顺序,此外您还可以将参数分组在一起。您在列表中指定参数的顺序Parameters将是它们在控制台中显示的顺序。

下面的示例取自aws 文档

Metadata: 
  AWS::CloudFormation::Interface: 
    ParameterGroups: 
      - 
        Label: 
          default: "Network Configuration"
        Parameters: 
          - VPCID
          - SubnetId
          - SecurityGroupID
      - 
        Label: 
          default: "Amazon EC2 Configuration"
        Parameters: 
          - InstanceType
          - KeyName
    ParameterLabels: 
      VPCID: 
        default: "Which VPC should this be deployed to?"
Run Code Online (Sandbox Code Playgroud)