首页 > 解决方案 > 订购模板中提到的参数

问题描述

在控制台中创建堆栈时,控制台会按逻辑 ID 的字母顺序列出输入参数。有办法使用接口自定义订单。

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

但是有没有办法按照模板中提到的那样对参数进行排序?

标签: amazon-cloudformationaws-cloudformation-custom-resource

解决方案


使用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?"

推荐阅读