【问题标题】:RDS launches with default group via aws cloudformationRDS 通过 aws cloudformation 使用默认组启动
【发布时间】:2018-07-12 08:18:10
【问题描述】:

我正在尝试使用 AWS cloudformation 从快照创建 RDS 实例。尽管指定了安全组,cloudformation 仍然使用默认安全组启动 RDS 实例。 我已在此处附加了我的代码 sn-p,我是否缺少它所期望的值?

RDSInstance:
Type: "AWS::RDS::DBInstance"
Properties:
  DBInstanceClass: db.m4.2xlarge
  DBInstanceIdentifier: TestRDS
  VPCSecurityGroups: ["sg-09r75bf44xxxx7689"]
  DBSubnetGroupName: dev-db-subnet
  DBSnapshotIdentifier: arn:aws:rds:us-east-1:333400xxxx866:snapshot:devrds1-new
  Tags:
  -
    Key: "Name"
    Value: "DBforTesting"

【问题讨论】:

    标签: amazon-web-services amazon-cloudformation amazon-rds


    【解决方案1】:

    您应该使用Fn::ImportValue 来获取您单独创建的安全组:

    VPCSecurityGroups: 
     - { "Fn::ImportValue" : "sg-09r75bf44xxxx7689" }
    

    如果在您的文件中声明了安全组,则应使用 Ref 引用它:

    VPCSecurityGroups: 
     - { "Ref" : "SecurityGroup" }
    

    【讨论】:

      猜你喜欢
      • 2021-12-11
      • 1970-01-01
      • 1970-01-01
      • 2017-11-18
      • 2018-06-26
      • 1970-01-01
      • 2015-08-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多