Retrieve a AWS CloudFormation exported value by its name
AWS exposes an API to list CloudFormation exports. However, retrieving the value of a particular export requires that you iterate over all the exports. This module aims to make this process easier.
pip install cfn_get_export_value
Suppose you have a CloudFormation stack that has an Output that exports its value (some-value
) by the name some-name
.
You can retrieve the value of some-name
like this:
from cfn_get_export_value import get_export_value
value = get_export_value('some-name')
# value: "some-value"
You can also specify a boto3 session argument:
get_export_value('some-name', session=some_session)