sparse-intern-71089
09/27/2022, 9:37 PMstocky-account-72012
09/27/2022, 9:37 PMinfrastructureexport const useClusterAttributes = (infraStackName: string, func: (outputs: ClusterAttributes) => any) => {
    const stackRef = new pulumi.StackReference(infraStackName)
    stackRef.getOutput('clusterName').apply(clusterName => { console.log(`The clusterName should be a string here, right?: ${clusterName}`) })
    return pulumi.all([
        stackRef.getOutput('vpcId'),
        stackRef.getOutput('publicSubnetIds'),
        stackRef.getOutput('privateSubnetIds'),
        stackRef.getOutput('clusterName'),
        stackRef.getOutput('kubeconfig'),
        stackRef.getOutput('clusterOidcProviderArn'),
        stackRef.getOutput('clusterOidcProviderUrl'),
    ])
        .apply(([
            vpcId,
            publicSubnetIds,
            privateSubnetIds,
            clusterName,
            kubeconfig,
            clusterOidcProviderArn,
            clusterOidcProviderUrl,
        ]) => {
            console.log(`At least should be a string here: ${clusterName}`);
            func({
                vpcId,
                publicSubnetIds,
                privateSubnetIds,
                clusterName,
                kubeconfig,
                clusterOidcProviderArn,
                clusterOidcProviderUrl,
            })
        })
}console.logstocky-account-72012
09/27/2022, 9:39 PMuseClusterAttributes(infraStackName, async ({
    vpcId,
    clusterName,
    kubeconfig,
    clusterOidcProviderArn,
    clusterOidcProviderUrl,
}) => {
    const k8sProvider = ensureProvider(clusterName, kubeconfig)
   ... declare more resources down here ...
})stocky-account-72012
09/27/2022, 9:40 PMapplyuserClusterAttributespulumi.allapplystocky-account-72012
09/27/2022, 9:42 PMclusterNamevpcIdundefinedk8sProviderError: Missing resource name argument (for URN creation)console.loghello orgname/infrastructure/stackname
    OutputImpl {
      __pulumiOutput: true,
      resources: [Function (anonymous)],
      allResources: [Function (anonymous)],
      isKnown: Promise { <pending> },
      isSecret: Promise { <pending> },
      promise: [Function (anonymous)],
      toString: [Function (anonymous)],
      toJSON: [Function (anonymous)]
    }
    The clusterName should be a string here, right?: undefined
    At least should be a string here: undefinedstocky-account-72012
09/27/2022, 9:42 PMstackRef.getOutputundefinedstocky-account-72012
09/27/2022, 9:45 PMbillowy-army-68599
stocky-account-72012
09/27/2022, 9:51 PMconst stackName = pulumi.getStack();
const infraStackName = `orgname/infrastructure/${stackName}`;
useClusterAttributes(infraStackName, async ({
    vpcId,
    clusterName,
    kubeconfig,
    clusterOidcProviderArn,
    clusterOidcProviderUrl,
}) => {
..........
})export const useClusterAttributes = (infraStackName: string, func: (outputs: ClusterAttributes) => any) => {
    const stackRef = new pulumi.StackReference(infraStackName)
.......billowy-army-68599
stocky-account-72012
09/27/2022, 10:10 PMconsole.loginfraStackNameuseClusterAttributesorgname/infrastructure/stacknameinfraStackNameerror: Preview failed: unknown stack "orgname/infrararastructure/stackname"billowy-army-68599
billowy-army-68599
.applybillowy-army-68599
stackRef.getOutput('vpcId'),
        stackRef.getOutput('publicSubnetIds'),
        stackRef.getOutput('privateSubnetIds'),
        stackRef.getOutput('clusterName'),
        stackRef.getOutput('kubeconfig'),
        stackRef.getOutput('clusterOidcProviderArn'),
        stackRef.getOutput('clusterOidcProviderUrl'),billowy-army-68599
stocky-account-72012
09/27/2022, 10:16 PMbillowy-army-68599
billowy-army-68599
stocky-account-72012
09/27/2022, 10:16 PMstocky-account-72012
09/27/2022, 10:18 PMprocessprocessClusterNameprocessVpcIdprocessprocessClusterNamepulumi upclusterNameprocessstocky-account-72012
09/27/2022, 10:19 PMstocky-account-72012
09/27/2022, 10:20 PMprocessClusterNameundefinedstocky-account-72012
09/27/2022, 10:20 PMbillowy-army-68599
upstocky-account-72012
09/27/2022, 10:24 PMstocky-account-72012
09/27/2022, 10:35 PMstocky-account-72012
09/27/2022, 10:36 PMpulumi upstocky-account-72012
09/27/2022, 11:07 PMinfrastructure