如何获得“ cidrblock”?子网位于“输出”中。的AWS Cloudformation? [英] How get "cidrblock" of a subnet in the "outputs" of a AWS Cloudformation?

查看:351
本文介绍了如何获得“ cidrblock”?子网位于“输出”中。的AWS Cloudformation?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写AWS代码格式。我必须打印子网的Cidrblock。但这不起作用。请帮助

I am writing a AWS Code formation. I have to print the Cidrblock of a subnet. But that does not work. Please help

"Resources": {
    "Subnet": {
          "Type": "AWS::EC2::Subnet",
          "Properties": {
            "VpcId": {
              "Ref": "VPC"
            },
            "CidrBlock": "10.0.0.0/16",
          }
    },
    Outputs : {
      "SubnetCIDR": {
          "Value": {
            "Fn::GetAtt": [
              "Subnet",
              "CidrBlock"
            ]
          },
          "Description": "The CIDR"
        },
    }

这不起作用。上载模板时显示以下错误消息:

This does not work. The following error message is shown while uploading the template:


模板验证错误:模板错误:资源子网不具有
支持属性在Fn :: GetAtt

Template validation error: Template error: resource Subnet does not support attribute type CidrBlock in Fn::GetAtt


推荐答案

不支持。

http:/ /docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-subnet.html

如果您查看该文档,唯一受支持的属性是 AvailabilityZone

If you look at the doc, the only supported attribute is AvailabilityZone

这篇关于如何获得“ cidrblock”?子网位于“输出”中。的AWS Cloudformation?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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