This is from the example code and it is running in...
# general
c
This is from the example code and it is running into an error
error: unexpected null property rrdatas[0]
m
Is that also the case if property values that refer to an actual address are passed to
gcp.compute.getAddress
?
(i.e. rather than
{ name: 'foobar', region: 'us-central1', project: 'abcd' }
etc.)
c
@microscopic-florist-22719 Yes that is the case. I would appreciate if you could try and recreate and post an example for creating a static IP.
Any update on this?
@gentle-diamond-70147 Would you be able to help with this?
g
Are you meaning to use
gcp.compute.getAddress
to get an existing static IP? Or are you wanting to create a new static IP?
c
I want a new Static IP
g
getAddress
is a function to get a static IP that already exists
you need to create a new Address - e.g.
const ip = new gcp.compute.Address(...
Copy code
import * as pulumi from '@pulumi/pulumi';
import * as gcp from '@pulumi/gcp';

const ip = new gcp.compute.Address('prod', {
    name: 'foobar',
});

const prod = new gcp.dns.ManagedZone('prod', {
    dnsName: 'prod.mydomain.com.'
});

const frontend = new gcp.dns.RecordSet('frontend', {
    name: pulumi.interpolate `frontend.${prod.dnsName}`,
    managedZone: prod.name,
    rrdatas: [ip.address],
    ttl: 300,
    type: 'A'
});