I can't figure out how do I convert the below section of my yaml cloudformation template to a json template. Can anyone please guide me here.
Tags:
- Key: Name
Value: !Join
- ''
- - !FindInMap
- BusinessUnitCode
- !Ref BusinessUnit
- Code
- A
- !FindInMap
- AWSRegionCode
- !Ref 'AWS::Region'
- Code
- '-'
- !FindInMap
- AccountsCode
- !Ref Account
- Code
- '-'
- !FindInMap
- ProdLevelCode
- !Ref ProductionLevel
- Code
- '-'
- !FindInMap
- ServerFunctionCode
- !Ref ServerFunction
- Code
- '-'
- !FindInMap
- SGFunctionCode
- !Ref SecurityGroupFunction
- Code
- '-'
- !Ref IncrementCode
Though I know there is no need for this conversion as both json and yaml works the same in cloudformation, have to do this as per a mandate.
To convert a YAML document to JSON, follow these steps: Select the YAML to JSON action from the XML Tools > JSON Tools menu. Choose or enter the YAML URL for the document you want to convert. Choose the path of the Output file that will contain the resulting JSON document.
YAML CloudFormation fully supports all of the same features and functions as JSON CloudFormation with some additional features to reduce the length of code and increase readability. Say goodbye to the curly braces and most of the quotation marks of JSON when you use YAML.
You simply create a separate template for the resources that you want to reuse and then save that template in an Amazon S3 bucket. Whenever you want to add those resources in another template, use the AWS::CloudFormation::Stack resource to specify the S3 URL of the nested template.
For more information about the template syntax for each format, see Template anatomy. AWS CloudFormation follows the ECMA-404 JSON standard. For more information about the JSON format, see http://www.json.org . AWS CloudFormation supports the YAML Version 1.1 specification with a few exceptions.
AWS Console can help you with that. Open your CloudFormation template in template designer.
CloudFormation > Select your stack > Template > View in designer
You can then easily convert your template by choosing your template language as Json.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With