// create a nat gateway
const natGateway = new ec2.CfnNatGateway(this, 'nat-gateway-1',{
subnetId: mySubnet.subnetId,
allocationId: new ec2.CfnEIP(this, 'eip-1', {
domain: 'vpc'
}).attrAllocationId
})
// create a route table
const routeTable = new ec2.CfnRouteTable(this, 'route-table-1', {
vpcId: vpc.vpcId,
})
// create route
const route = new ec2.CfnRoute(this, 'route-1', {
// how to get the route table id?
routeTableId: 'how to get the id?',
natGatewayId: 'how to get the id?',
destinationCidrBlock: vpc.vpcCidrBlock
})
When I create a route table or a nat gateway, how can I get the ID? I am working with typescript