我正在尝试根据安全组的名称来命名我的安全组,但是我的问题是我也希望包括一个组类型名称。例如:
我尝试过
somerdsgroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: "RDS Security Group"
Tags:
-
key: "env"
value: Ref: envT
-
key:"name"
value: #here i want like demo-cron
VpcId: Ref: myVpcid
我希望结果像
name : demo-cron
或name : dev-cron
取决于envT
变量?
答案 0 :(得分:0)
这应该有效:
somerdsgroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: "RDS Security Group"
Tags:
- key: "env"
value: Ref: envT
- key:"name"
value: !Sub "{envT}-${group}"
VpcId: Ref: myVpcid