I am writing aws cloudformation code. Could you possibly make it more concise than the code I wrote?
PublicSubnet:
Type: AWS::EC2::Subnet
Properties:
VPCId: !Ref VPC
CibrBlock: !Sub
- ${CibrBlockHeader}
- { CibrBlockHeader: If [ IsProd, !FindInMap [ VPC, CibrBlockHeader, CibrBlockFooter ], !FindInMap [ VPC, DevCibrBlockHeader, CibrBlockFooter ] ] }
CodePudding user response:
I think the following should work (don't need Sub):
PublicSubnet:
Type: AWS::EC2::Subnet
Properties:
VPCId: !Ref VPC
CibrBlock:
CibrBlockHeader: If [ IsProd, !FindInMap [ VPC, CibrBlockHeader, CibrBlockFooter ], !FindInMap [ VPC, DevCibrBlockHeader, CibrBlockFooter ] ]
