gpt4 book ai didi

aws-cloudformation - 从 cloudformation 模板绘制图像

转载 作者:行者123 更新时间:2023-12-03 21:25:13 24 4
gpt4 key购买 nike

是我可以用来将 cloudformation 模板 转换为图表的任何绘图/导出工具。

需要将我的cloudformation堆栈导出到图像graphviz文件中。

问候,

最佳答案

您可以使用最新版本的cfn-lint用于从模板获取资源图表的工具。

像这样使用它:

pip3 install cfn-lint pydot
cfn-lint template.json -g

例如,它将生成一个如下所示的 DOT 文件:

Resource dependency graph

对应此模板:

{
"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 Linter Visual Studio Code extension还有一个resource dependency graph preview button编辑 CloudFormation 模板时右上角:

Resource dependency graph in Visual Studio Code extension

关于aws-cloudformation - 从 cloudformation 模板绘制图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48102947/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com