wag*_*nza 6 aws-cloudformation aws-cli
cloudformation 是我可以用来将模板转换为图表的任何绘图/导出工具。
需要将我的cloudformation 堆栈导出到图像或graphviz文件中。
问候,
您可以使用最新版本的cfn-lint工具从模板中获取资源图表。
像这样使用它:
pip3 install cfn-lint pydot
cfn-lint template.json -g
Run Code Online (Sandbox Code Playgroud)
例如,它将生成一个如下所示的 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"
]
}
}
]
}
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
在编辑 CloudFormation 模板时, CloudFormation Linter Visual Studio Code 扩展的右上角还有一个资源依赖关系图预览按钮:
| 归档时间: |
|
| 查看次数: |
3626 次 |
| 最近记录: |