brainy-cricket-15245
11/10/2023, 7:11 PM* Error creating ForwardingRule: googleapi: Error 400: Invalid value for field 'resource.loadBalancingScheme': 'EXTERNAL'. Invalid field set in Private Service Connect Forwarding Rule. This field should not be set., invalid
That one goes away if I manually set loadBalancingScheme
to be ''
(see below for code)
* Error creating ForwardingRule: googleapi: Error 400: Invalid value for field 'resource.labels': ''. Invalid field set in Private Service Connect Forwarding Rule. This field should not be set., invalid
This one won't go away, even after trying to manually set the labels
to be {}
, null
, and undefined
. Interestingly, I also get the exact same error when I provide an object with values in it! So it seems that the SDK is sending a request to the GCP API that has the labels set to ''
regardless of user input.
I'm using the typescript SDK, @pulumi/gcp@7.0.0
and @pulumi/pulumi@3.92.0
Here's the code I'm running:
const mongoEndpoint = new mongodbatlas.PrivateLinkEndpoint(
'mongoPrivateLinkEndpoint',
{
projectId: mongoProject.id,
providerName: 'GCP',
region: 'CENTRAL_US',
},
{ provider: getMongoAtlasProvider() }
);
const mongoSubnet = new gcp.compute.Subnetwork('mongo-atlas-subnet', {
name: `mongo-atlas-subnet-${projectId}`,
purpose: 'PRIVATE_RFC_1918',
ipCidrRange: '10.120.0.0/16',
ipv6AccessType: 'INTERNAL',
network: appVpcNetwork.selfLink,
region: location,
});
const endpoints: mongodbatlas.types.input.PrivateLinkEndpointServiceEndpoint[] = [];
// create 50 ips and forwarding rules
for (let i = 0; i < 50; i++) {
const ip = new gcp.compute.Address(`mongo-atlas-ip-${i}`, {
name: `mongo-atlas-ip-${i}`,
region: location,
subnetwork: mongoSubnet.selfLink,
addressType: 'INTERNAL',
});
const rule = new gcp.compute.ForwardingRule(`mongo-atlas-${i}`, {
region: location,
network: appVpcNetwork.name,
subnetwork: mongoSubnet.name,
ipAddress: ip.selfLink,
target: mongoEndpoint.serviceAttachmentNames[i],
loadBalancingScheme: '',
});
endpoints.push({
endpointName: rule.name,
ipAddress: ip.address,
});
}
new mongodbatlas.PrivateLinkEndpointService(
'mongoPrivateLinkEndpointService',
{
projectId: mongoProject.id,
providerName: 'GCP',
gcpProjectId: '<my-gcp-project>', // redacted
endpoints,
endpointServiceId: mongoSubnet.id,
privateLinkId: mongoEndpoint.id,
},
{ provider: getMongoAtlasProvider() }
);
blue-actor-6315
11/15/2023, 7:07 PM