Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cloudformation Reference Security group in DBCluster

I am creating a Database cluster with two DB instance using cloudformation.

For this i am able to create

DBSecGroup: Type: AWS::EC2::SecurityGroup

Then i need to reference it in property VpcSecurityGroupIds.

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

VpcSecurityGroupIds requires List. Not sure how i can do this.

like image 572
changed Avatar asked Dec 28 '25 18:12

changed


1 Answers

Try one of these two:

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

DBCluster:
  Type: AWS::RDS::DBCluster
  Properties:
    VpcSecurityGroupIds:
      - !Ref DBSecGroup

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

like image 171
jbasko Avatar answered Dec 31 '25 22:12

jbasko