https://pulumi.com logo
#azure
Title
# azure
a

adamant-leather-41068

12/21/2023, 11:16 PM
I have this code:
Copy code
const publicIp = new azure_native.network.PublicIPAddress(`${alphaonly_name(config.nameConfig)}-publicIP`, {
    resourceGroupName: resourceGroup.name,
    publicIPAllocationMethod: azure_native.network.IPAllocationMethod.Dynamic,
  });

  publicIp.ipAddress.apply(ip => {
    if (ip) {
      //setupServices(ip, sshPrivateKey, config)
      console.log(`IP address is ${ip}`)
    } else {
      //throw new Error(`Could not setup services as IP address was ${ip}`);
      console.log(`Could not setup services as IP address was ${ip}`)
    }
  })
In the
apply
function
ip
is always undefined, but I can look in the Azure console and see a new IP address is created. What am I doing wrong? ``````
s

some-ambulance-32599

12/29/2023, 9:27 AM
Copy code
publicIp.Apply(x=> if(x.ipAddress)...