Is the any drawing / export tool that I can use to turn a cloudformation
template into a diagram.
In need to export my cloudformation
stack into an image, or a graphviz file.
Regards,
You can use the latest version of the cfn-lint tool to get a graph of resources from your template.
Use it like this:
pip3 install cfn-lint pydot
cfn-lint template.json -g
For example, it will generate a DOT file that renders like this:
Which corresponds to this template:
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Sample template that demonstrates Fn::GetAtt",
"Resources": {
"DetectTextInImage": {
"Type": "AWS::Lambda::Function",
"Properties": {
"Role": {
"Fn::GetAtt": [
"DetectTextInImageRole",
"Arn"
]
}
}
},
"DetectTextInImageBucketEvent1Permission": {
"Type": "AWS::Lambda::Permission",
"Properties": {}
},
"DetectTextInImageRole": {
"Type": "AWS::IAM::Role",
"Properties": {}
},
"ResultsTable": {
"Type": "AWS::DynamoDB::Table",
"Properties": {}
},
"SourceImageBucket": {
"Type": "AWS::S3::Bucket",
"Properties": {
"NotificationConfiguration": {
"LambdaConfigurations": [
{
"Function": {
"Fn::GetAtt": [
"DetectTextInImage",
"Arn"
]
}
}
]
}
}
}
}
}
The CloudFormation Linter Visual Studio Code extension also has a resource dependency graph preview button in the top right while editing CloudFormation templates:
You can use the AWS CloudFormation designer. Click on Open, then upload your template. Finally take a screenshot of the result to have it in an image format.
Here's an exemple of what the result might look like:
For more information, have a look at the doc.
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