https://pulumi.com logo
#google-cloud
Title
# google-cloud
c

creamy-engineer-83524

03/02/2020, 8:30 PM
When creating a
new gcp.cloudrun.DomainMapping
, how do I use the output's resource records to create a new
new gcp.dns.RecordSet
? I tried this, but won't work:
Copy code
const mapping = new gcp.cloudrun.DomainMapping(...)
new gcp.dns.RecordSet(
    `${prefix}-a-records`,
    {
      name: 'xxx.',
      managedZone: zone.name,
      type: 'A',
      ttl: 3600,
      rrdatas: mapping.status.resourceRecords,
    },
    {
      dependsOn: [zone, mapping],
      deleteBeforeReplace: true,
    },
  )
The issue is: error TS2322: Type 'Output<DomainMappingStatusResourceRecord[]>' is not assignable to type 'Input<Input<string>[]>'.
t

tall-librarian-49374

03/02/2020, 8:42 PM
Should be something like
mapping.status.resourceRecords.apply(rs => rs && rs.map(r => r.rrdata))
I responded at SO
c

creamy-engineer-83524

03/02/2020, 9:15 PM
Ah thanks! I'll try it and respond back at SO.