Title
a

adorable-action-51248

04/12/2021, 6:04 PM
Hi ! I had a working cloudrun deployment with custom domain mapping. I upgraded to the latest version of pulumi (2.24.1) + pulumi.gcp (4.19.0) (nodejs) now the deployment is broken. I used code similar to this:
const mapping = new gcp.cloudrun.DomainMapping(...);

const records = mapping.status.resourceRecords?.apply(rs => rs ?? []) ?? pulumi.output([]);

const domainMapping  = new gcp.dns.RecordSet(`${prefix}-a-records`, {
    name: 'xxx.',
    managedZone: zone.name,
    type: 'A',
    ttl: 3600,
    rrdatas: records.apply(rs => rs.map(r => r.rrdata)),
}, {
    dependsOn: [zone, mapping],
    deleteBeforeReplace: true,
});
according to the docs i would need to replace
mapping.status
with
mapping.statuses[0]
. however, it seems that
statuses
is an empty array. The error messages I receive is:
Error 400: Invalid value for 'entity.change.deletions[0].rrdata': '<empty>'
More details:
    Reason: invalid, Message: Invalid value for 'entity.change.deletions[0].rrdata': '<empty>'
    Reason: invalid, Message: Invalid value for 'entity.change.additions[0].rrdata': '<empty>'
when i add
domainMapping.statuses.apply(s => console.error(JSON.stringify(s))
it prints
undefined
any ideas what might be the issue here?
b

billowy-army-68599

04/13/2021, 3:25 AM
it looks like the schema for this resource might have changed, you'll have to updated your code unfortunately
a

adorable-action-51248

04/13/2021, 5:57 AM
I tried to update
But the edits i tried do not work
Since statuses is empty
ok.
i did some tests with older packages.
and older pulumi versions.
it seems this doesnt work anymore
so i guess i need to hardcode
rrdatas
to
['<http://ghs.googlehosted.com|ghs.googlehosted.com>.']
mmh. the weird part is the rest api of cloud run still documents these fields: https://cloud.google.com/run/docs/reference/rest/v1/namespaces.domainmappings#DomainMappingStatus