I'm trying to reference a couple of subnets to create ec2 instances but I'm sort of stuck. Let's say I have this:
const vpc = new Vpc(this, 'gwc-vpc', {
cidr: "10.20.0.0/16",
maxAzs: 3,
subnetConfiguration: [
{
subnetType: SubnetType.PRIVATE,
name: 'gossipSubnet',
cidrMask: 24
},
{
subnetType: SubnetType.PRIVATE,
name: 'dbSubnet',
cidrMask: 24
},
{
subnetType: SubnetType.PUBLIC,
name: 'extSubnet',
cidrMask: 24
}
]
})
How can I create an instance in the dbSubnet for example? Even better, what if I want to create an EC2 instance with 2 interfaces each of one is sitting in a different subnet (dbSubnet and gossipSubnet)? Any ideas?
Thanks!