【发布时间】:2018-06-14 15:17:18
【问题描述】:
是我可以用来将cloudformation 模板 转换为图表的任何绘图/导出工具。
需要将我的cloudformation stack 导出到 image 或 graphviz 文件中。
问候,
【问题讨论】:
标签: amazon-cloudformation aws-cli
是我可以用来将cloudformation 模板 转换为图表的任何绘图/导出工具。
需要将我的cloudformation stack 导出到 image 或 graphviz 文件中。
问候,
【问题讨论】:
标签: amazon-cloudformation aws-cli
【讨论】:
您可以使用最新版本的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:
【讨论】: