Hi.
I’m using the TypeScript CDK and trying to do something simple: set up a VPC network in GCP.
const network = new gcp.ComputeNetwork(this, `primary-network`, {
name: `primary-network`,
autoCreateSubnetworks: false,
routingMode: 'REGIONAL',
})
new gcp.ComputeSubnetwork(this, `private-subnet-${config.region}`, {
name: `private-subnet-${config.region}`,
region: config.region,
ipCidrRange: '10.0.0.0/8',
privateIpGoogleAccess: true,
network: network.id,
dependsOn: [network],
})
The problem I have above is that network.id
is of type string | undefined
and because of that I cannot assign it to the field ComputeSubnetwork.network
which expects a type string
: