5

我在 CloudFormation 模板中检索新 RDS Aurora Serverless 集群的 ARN 时遇到问题。

有人可以建议输出值应该低于什么参考值吗?

Resources:
  RDSCluster:
    Type: AWS::RDS::DBCluster
    Properties:
      MasterUsername: someusername
      MasterUserPassword: somepass
      DatabaseName: mydb
      Engine: aurora-postgresql
      EngineMode: serverless
      EngineVersion: '10.7'
      EnableHttpEndpoint: true
      ScalingConfiguration:
        AutoPause: false
        MaxCapacity: 16
        MinCapacity: 2
        SecondsUntilAutoPause: 300

Outputs:
  RDSClusterARN:
    Description: RDS Cluster ARN
    Export:
      Name: RDSCluster
    Value:
      Ref: RDSCluster # Help! What should this value be?

我目前得到的输出:

    {
        "OutputKey": "RDSClusterARN",
        "OutputValue": "t1-rdscluster-1i771l6x4amfg",
        "Description": "RDS Cluster ARN",
        "ExportName": "RDSCluster"
    },
4

1 回答 1

10

由于 AWS CloudFormationAWS::RDS::DBCluster资源的当前限制,您必须按如下方式手动构建其 ARN(另请参阅在 Amazon RDS 中使用 Amazon 资源名称 (ARN)

!Sub "arn:${AWS::Partition}:rds:${AWS::Region}:${AWS::AccountId}:cluster:${RDSCluster}"
于 2020-06-13T23:06:19.123 回答