在 CloudFormation 中获取 Aurora Serverless 集群 ARN(输出)

mar*_*ark 1 amazon-rds aws-cloudformation aws-rds-data-service

我在 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?
Run Code Online (Sandbox Code Playgroud)

我目前得到的输出:

    {
        "OutputKey": "RDSClusterARN",
        "OutputValue": "t1-rdscluster-1i771l6x4amfg",
        "Description": "RDS Cluster ARN",
        "ExportName": "RDSCluster"
    },
Run Code Online (Sandbox Code Playgroud)

fse*_*art 5

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

!Sub "arn:${AWS::Partition}:rds:${AWS::Region}:${AWS::AccountId}:cluster:${RDSCluster}"
Run Code Online (Sandbox Code Playgroud)