c

    creamy-fall-88031

    6 months ago
    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?
    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:
    {
       publicIPs: ipresource.id
    }
    w

    witty-candle-66007

    6 months ago
    It wants an array. Try
    publicIPs: [ipresource.id]
    c

    creamy-fall-88031

    6 months ago
    already did, it complains on that too
    although it most likely should be an array as the az command is the following:
    az aks update \
        --resource-group myResourceGroup \
        --name myAKSCluster \
        --load-balancer-outbound-ips <publicIpId1>,<publicIpId2>
    i'm confused.
    w

    witty-candle-66007

    6 months ago
    Can you show the actual Pulumi declaration code that includes the publicIPs property?
    c

    creamy-fall-88031

    6 months ago
    yes, of course.
    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

    6 months ago
    Is
    publicStaticIpAddress
    declared elsewhere as a
    PublicIpAddress
    via https://www.pulumi.com/registry/packages/azure-native/api-docs/network/publicipaddress/#
    c

    creamy-fall-88031

    6 months ago
    yes of course. but even if it was not i get complains in the code editor it self.
    w

    witty-candle-66007

    6 months ago
    Just making sure I wasn’t assuming anything on my side. So, this syntax appears to appease the SDE gods:
    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:
    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

    6 months ago
    i'm not sure i follow... like this?
    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

    6 months ago
    loadBalancerProfile: {
                outboundIPs: {
                    publicIPs:  [{id: publicStaticIPAddress.id}]
                }, 
            },  
    	},
    So it’s an array of objects of the form
    {id: IPADDRESS_ID}
    c

    creamy-fall-88031

    6 months ago
    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

    6 months ago
    🙂 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

    6 months ago
    I just did. 🙂
    w

    witty-candle-66007

    6 months ago
    thanks - have a good weekend
    c

    creamy-fall-88031

    6 months ago
    Thanks! You too!