1

I am having trouble retrieving the ARN for a new RDS Aurora Serverless cluster inside a CloudFormation template.

Can someone please advise on what reference the output value should be below?

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?

The output I currently get:

    {
        "OutputKey": "RDSClusterARN",
        "OutputValue": "t1-rdscluster-1i771l6x4amfg",
        "Description": "RDS Cluster ARN",
        "ExportName": "RDSCluster"
    },
mark
  • 1,604
  • 1
  • 18
  • 39

1 Answers1

5

Because of current limitations of the AWS CloudFormation AWS::RDS::DBCluster resource, you have to construct its ARN by hand as follows (see also Working with Amazon Resource Names (ARNs) in Amazon RDS)

!Sub "arn:${AWS::Partition}:rds:${AWS::Region}:${AWS::AccountId}:cluster:${RDSCluster}"
Pat Myron
  • 3,231
  • 2
  • 18
  • 34
fsenart
  • 4,938
  • 2
  • 30
  • 49