0

I'm exporting the name of the stack and the URL of my Lambda function in my CloudFormation template.

Outputs:
  LambdaInvokeURL:
    Value: !GetAtt Myurl.FunctionUrl 
    Export:
      Name: !Sub "${AWS::StackName}"

I have 8 to 10 stacks exporting similar outputs.

How can I list all exported names & values across all stacks in my AWS account?

Should I write a new CloudFormation template or a Lambda function to list them?

1 Answer 1

1

Use the aws cloudformation list-exports CLI command, the ListExports API or any of the equivalent SDK methods.

You don’t need to write a new CloudFormation template or a Lambda function for this.

Sample output as per docs:

{
    "Exports": [
        {
            "ExportingStackId": "arn:aws:cloudformation:us-west-2:123456789012:stack/private-vpc/99764070-b56c-xmpl-bee8-062a88d1d800",
            "Name": "private-vpc-subnet-a",
            "Value": "subnet-07b410xmplddcfa03"
        },
        {
            "ExportingStackId": "arn:aws:cloudformation:us-west-2:123456789012:stack/private-vpc/99764070-b56c-xmpl-bee8-062a88d1d800",
            "Name": "private-vpc-subnet-b",
            "Value": "subnet-075ed3xmplebd2fb1"
        },
        {
            "ExportingStackId": "arn:aws:cloudformation:us-west-2:123456789012:stack/private-vpc/99764070-b56c-xmpl-bee8-062a88d1d800",
            "Name": "private-vpc-vpcid",
            "Value": "vpc-011d7xmpl100e9841"
        }
    ]
}
1
  • 1
    Very useful command. Bounty is added to reward this.
    – shantanuo
    Apr 16 at 9:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.