cloudtools / troposphere

troposphere - Python library to create AWS CloudFormation descriptions
BSD 2-Clause "Simplified" License
4.93k stars 1.45k forks source link

Add support for Fn::ToJsonString #2107

Open uldall opened 1 year ago

uldall commented 1 year ago

It seems like the new ToJsonString intrinsic function is not yet available in Troposphere: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-ToJsonString.html

An example use-case for the function is to be able to use the return value "OpenWireEndpoints" of AWS:AmazonMQ:Broker as an environment variable for an Elastic Beanstalk environment:

 OptionSetting(
    OptionName="ACTIVE_MQ_ENDPOINTS",
    Namespace="aws:elasticbeanstalk:application:environment",
    Value=ToJsonString(GetAtt(broker, "OpenWireEndpoints"))
),