Cidr

The cidr method is the CloudFormation Fn::Cidr equivalent.

Example Snippet

resource("ExampleSubnet", "AWS::EC2::Subnet",
  AssignIpv6AddressOnCreation: "true",
  CidrBlock: select("0", cidr(get_att("ExampleVpc.CidrBlock"), "1", "8")),
  VpcId: ref("ExampleVpc")}
)

Example Output

Resources:
  ExampleSubnet:
    Type: AWS::EC2::Subnet
    Properties:
      AssignIpv6AddressOnCreation: 'true'
      CidrBlock:
        Fn::Select:
        - '0'
        - Fn::Cidr:
          - Fn::GetAtt:
            - ExampleVpc
            - CidrBlock
          - '1'
          - '8'
      VpcId:
        Ref: ExampleVpc

Back to Intrinsic Functions List.

Pro tip: Use the <- and -> arrow keys to move back and forward.

Edit this page

See a typo or an error? You can improve this page. This website is available on GitHub and contributions are encouraged and welcomed. We love pull requests from you!