DBCluster 中的 Cloudformation 参考安全组

cha*_*ged 3 aws-cloudformation

我正在使用 cloudformation 创建一个包含两个数据库实例的数据库集群。

为此我能够创建

DBSecGroup: Type: AWS::EC2::SecurityGroup

然后我需要在属性 VpcSecurityGroupIds 中引用它。

DBCluster: Type: "AWS::RDS::DBCluster" VpcSecurityGroupIds: ?

VpcSecurityGroupIds 需要列表。不知道我该怎么做。

jba*_*sko 5

尝试以下两种之一:

DBCluster:
  Type: AWS::RDS::DBCluster
  Properties:
    VpcSecurityGroupIds:
      - !GetAtt DBSecGroup.GroupId

DBCluster:
  Type: AWS::RDS::DBCluster
  Properties:
    VpcSecurityGroupIds:
      - !Ref DBSecGroup
Run Code Online (Sandbox Code Playgroud)

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-security-group.html#w2ab1c21c10d102d104c13