从cloudformation模板绘制图像 [英] Drawing an image from a cloudformation template

查看:93
本文介绍了从cloudformation模板绘制图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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



需要将我的 cloudformation 堆栈导出到 image graphviz 文件。



问候,

解决方案

您可以使用最新版本的



对应于thi s模板:

  {
AWSTemplateFormatVersion: 2010-09-09,
说明:演示Fn :: GetAtt的示例模板,
资源:{
DetectTextInImage:{
Type: AWS :: Lambda :: Function,
属性:{
角色:{
Fn :: GetAtt:[
DetectTextInImageRole,
Arn
]
}
}
},
DetectTextInImageBucketEvent1Permission:{
Type: AWS :: Lambda :: Permission,
Properties: {}
},
DetectTextInImageRole:{
Type: AWS :: IAM :: Role,
属性:{}
} ,
ResultsTable:{
Type: AWS :: DynamoDB :: Table,
Properties:{}
},
SourceImageBucket :{
类型: AWS :: S3 :: Bucket,
属性:{
NotificationConfiguration:{
LambdaConfiguration s:[
{
Function:{
Fn :: GetAtt:[
DetectTextInImage,
Arn
]
}
}
]
}
}
}
}
}


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"
                ]
              }
            }
          ]
        }
      }
    }
  }
}

这篇关于从cloudformation模板绘制图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆