我可以使用任何绘图/导出工具将cloudformation
模板转换为图表。
需要将cloudformation
堆栈导出到图像或 graphviz 文件中。
此致
答案 0 :(得分:1)
答案 1 :(得分:1)
您可以使用cfn-lint工具的最新版本来从模板中获取资源图。
像这样使用它:
pip3 install cfn-lint pydot
cfn-lint template.json -g
例如,它将生成一个如下所示的DOT文件:
与此模板相对应:
{
"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"
]
}
}
]
}
}
}
}
}
编辑CloudFormation模板时,CloudFormation Linter Visual Studio Code extension的右上角还有一个resource dependency graph preview button: