【问题标题】:Drawing an image from a cloudformation template从 cloudformation 模板绘制图像
【发布时间】:2018-06-14 15:17:18
【问题描述】:

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

需要将我的cloudformation stack 导出到 imagegraphviz 文件中。

问候,

【问题讨论】:

    标签: amazon-cloudformation aws-cli


    【解决方案1】:

    您可以使用AWS CloudFormation designer。点击打开,然后上传您的模板。最后截取结果的屏幕截图以将其转换为图像格式。

    以下是结果的示例:

    如需了解更多信息,请查看doc

    【讨论】:

      【解决方案2】:

      您可以使用最新版本的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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2012-12-11
        • 2012-11-08
        • 1970-01-01
        • 2020-11-01
        • 1970-01-01
        • 2020-03-31
        • 1970-01-01
        • 2019-08-17
        相关资源
        最近更新 更多