
CloudFormation を使用して、SG に VPC ID をハードコーディングせずに複数の VPC 用の SG を作成する必要があります。以下はハードコーディングされた VPC の例ですが、マッピングやその他のロジックから VPC ID を取得する方法はありますか?
MySecurityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: My Security Group
VpcId:
- VpcId1
- VpcId2
- VpcId3
SecurityGroupEgress:
- IpProtocol: -1
CidrIp: 0.0.0.0/0