There is a vpc definition via
const vpc = new ec2.Vpc(this, 'SomeVPC', {
cidr: '10.0.0.0/16',
maxAzs: 2,
});
Under the hood it creates 2 EIP for NAT gateways
"SomeVPCPublicSubnet1EIP58E3D6C5": {
"Type": "AWS::EC2::EIP",
"Properties": {
"Domain": "vpc"
}
}
how to grab the references to them and export it via CfnOutput
? Something like this:
new CfnOutput(this, "ExternalIPOutput", {value: <some magic call to get SomeVPCPublicSubnet1EIP58E3D6C5.ref()>})
CfnOutput
print strings only