fierce-engine-31599
05/06/2021, 12:20 PMconst runningService = pulumi.output(
gcp.cloudrun.getService(
{ name, location },
{
async: true,
},
),
);
const service = new gcp.cloudrun.Service(
name,
{
name,
// autogenerateRevisionName: true,
location,
traffics: runningService.traffics,
template: {
metadata: {
name: 'api-rolling-test3',
annotations: {
'<http://run.googleapis.com/vpc-access-connector|run.googleapis.com/vpc-access-connector>': vpcConnector.name,
'<http://run.googleapis.com/vpc-access-egress|run.googleapis.com/vpc-access-egress>': 'private-ranges-only',
},
},
spec: {
serviceAccountName: serviceAccount.email,
containers: [
{
image,
resources: { limits: { cpu: '1', memory: '512Mi' } },
envs: secrets,
},
],
containerConcurrency: 250,
},
},
},
{ dependsOn: [...iamMembers, redis] },
);
Above is the service creation and then I want to update only the traffic property so I'm trying to create another service:
new gcp.cloudrun.Service(
name,
{
name,
location,
traffics: [
{
revisionName: runningService.traffics[0].revisionName,
percent: 99,
},
{
revisionName: service.template.apply(
(template) => template?.metadata.name || '',
),
percent: 1,
},
],
},
{ dependsOn: [service] },
);
But it throws duplicate urn error 🥴bumpy-summer-9075
05/06/2021, 12:52 PMname
, the first parameter should be different for every resource of the same typefierce-engine-31599
05/06/2021, 1:53 PMtraffics
object somehow. If it was a regular JavaScript program I would just do service.traffics = ...
but I can't so I'm trying to find a workaroundred-match-15116
05/06/2021, 2:38 PMfierce-engine-31599
05/06/2021, 3:06 PMred-match-15116
05/06/2021, 3:10 PM