https://pulumi.com logo
#getting-started
Title
# getting-started
c

creamy-fall-88031

03/25/2022, 5:16 PM
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

witty-candle-66007

03/25/2022, 5:20 PM
It wants an array. Try
publicIPs: [ipresource.id]
c

creamy-fall-88031

03/25/2022, 5:20 PM
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

witty-candle-66007

03/25/2022, 5:42 PM
Can you show the actual Pulumi declaration code that includes the publicIPs property?
c

creamy-fall-88031

03/25/2022, 6:05 PM
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

witty-candle-66007

03/25/2022, 6:12 PM
Is
publicStaticIpAddress
declared elsewhere as a
PublicIpAddress
via https://www.pulumi.com/registry/packages/azure-native/api-docs/network/publicipaddress/#
c

creamy-fall-88031

03/25/2022, 6:17 PM
yes of course. but even if it was not i get complains in the code editor it self.
w

witty-candle-66007

03/25/2022, 6:32 PM
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

creamy-fall-88031

03/25/2022, 6:50 PM
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

witty-candle-66007

03/25/2022, 6:54 PM
Copy code
loadBalancerProfile: {
            outboundIPs: {
                publicIPs:  [{id: publicStaticIPAddress.id}]
            }, 
        },  
	},
So it’s an array of objects of the form
{id: IPADDRESS_ID}
c

creamy-fall-88031

03/25/2022, 6:55 PM
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

witty-candle-66007

03/25/2022, 6:56 PM
🙂 No problem. Glad to have helped.
looks like you opened an issue on this? do you want to follow up on it?
c

creamy-fall-88031

03/25/2022, 6:59 PM
I just did. 🙂
w

witty-candle-66007

03/25/2022, 7:01 PM
thanks - have a good weekend
c

creamy-fall-88031

03/25/2022, 7:10 PM
Thanks! You too!
4 Views