need to create SG for mutiple VPCs using cloudformation with out hard coding vpc ids in SG below is example with hard coded vpc but is there way u can get VPC id from mapping or anyother logic
MySecurityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: My Security Group
VpcId:
- VpcId1
- VpcId2
- VpcId3
SecurityGroupEgress:
- IpProtocol: -1
CidrIp: 0.0.0.0/0