Guys, a bit of ts help please. I don't understand...
# getting-started
c
Guys, a bit of ts help please. I don't understand what pulumi is expecting here as input. There is pulumi.input<pulumi.input twice of which the first is I guess an array?
Copy code
interface ManagedClusterLoadBalancerProfileOutboundIPsArgs {
        /**
         * A list of public IP resources.
         */
        publicIPs?: pulumi.Input<pulumi.Input<inputs.containerservice.ResourceReferenceArgs>[]>;
so...
publicIPs: what_exactly
?? The following is clearly not correct:
Copy code
{
   publicIPs: ipresource.id
}
w
It wants an array. Try
publicIPs: [ipresource.id]
c
already did, it complains on that too
although it most likely should be an array as the az command is the following:
Copy code
az aks update \
    --resource-group myResourceGroup \
    --name myAKSCluster \
    --load-balancer-outbound-ips <publicIpId1>,<publicIpId2>
i'm confused.
w
Can you show the actual Pulumi declaration code that includes the publicIPs property?
c
yes, of course.
Copy code
const cluster = new containerservice.ManagedCluster(managedClusterName, {
    resourceGroupName: resourceGroup.name,
    resourceName: `aks-${environmentLabel}`,
    agentPoolProfiles: [{
        count: 2,
        maxPods: 110,
        mode: "System",
        name: "agentpool",
        nodeLabels: {},
        osDiskSizeGB: 30,
        osType: "Linux",
        type: "VirtualMachineScaleSets",
        vmSize: "Standard_B2s",
        vnetSubnetID: aksSubnet.id,
    }],
    dnsPrefix: resourceGroup.name,
    enableRBAC: true,
    kubernetesVersion: "1.23.3",
    linuxProfile: {
        adminUsername: "testuser",
        ssh: {
            publicKeys: [{
                keyData: sshKey.publicKeyOpenssh,
            }],
        },
    },
	networkProfile: {
		networkPlugin: "azure",
		serviceCidr: "10.10.0.0/24",
		dnsServiceIP: "10.10.0.10",
		dockerBridgeCidr: "172.17.0.1/16",
        loadBalancerProfile: {
            outboundIPs: {
                publicIPs:  publicStaticIPAddress.id
            }, 
        },  
	},   
    // nodeResourceGroup: `MC_azure-go_${managedClusterName}`,
    nodeResourceGroup: `mc_${managedClusterName}`,
    servicePrincipalProfile: {
        clientId: adApp.applicationId,
        secret: adSpPassword.value,
    },
},
w
Is
publicStaticIpAddress
declared elsewhere as a
PublicIpAddress
via https://www.pulumi.com/registry/packages/azure-native/api-docs/network/publicipaddress/#
c
yes of course. but even if it was not i get complains in the code editor it self.
w
Just making sure I wasn’t assuming anything on my side. So, this syntax appears to appease the SDE gods:
Copy code
publicIPs:  [<azure_native.types.input.containerservice.ResourceReferenceArgs>publicStaticIPAddress.id]
I have not tried a
pulumi up
darn -
pulumi up
is throwing an error …
Oh. But this seems to be working:
Copy code
publicIPs:  [<azure_native.types.input.containerservice.ResourceReferenceArgs>{id: publicIPAddress.id}]
Note the object
{id: publicIpAddress.id}
(and note resource names are different)
and probably don’t need the typecasting
c
i'm not sure i follow... like this?
Copy code
publicIPs:  {
      id: publicIPAddress.id
}
I don't understand,
publicIpAddress
is just a name for the constructor, you can name it however you want to...
w
Copy code
loadBalancerProfile: {
            outboundIPs: {
                publicIPs:  [{id: publicStaticIPAddress.id}]
            }, 
        },  
	},
So it’s an array of objects of the form
{id: IPADDRESS_ID}
c
yeah...
I should've stick to Golang
😄
Thank you very much for your time and help with this @witty-candle-66007! I owe you one!
w
🙂 No problem. Glad to have helped.
looks like you opened an issue on this? do you want to follow up on it?
c
I just did. 🙂
w
thanks - have a good weekend
c
Thanks! You too!