most-parrot-35986
11/05/2019, 7:44 AMTypeError: Cannot read property 'kubeconfig' of undefined
. The documentation and code examples suggests I should have access to the kubeconfig and provider from the output. Can I get someone to take a look at see if I just missed something here? Much appreciated.
// Create method in EKS class
async createEksCluster (networking) {
try {
const cluster = new eks.Cluster(this.clusterName, {
endpointPrivateAccess: this.apiPrivateAccess,
endpointPublicAccess: this.apiPublicAccess,
skipDefaultNodeGroup: true,
version: this.version,
vpcId: networking.apply(network => network.vpcId),
subnets: networking.apply(network => network.publicSubnetIds),
nodeAssociatePublicIpAddress: false,
deployDashboard: false,
tags: {
stack: this.stack
}
})
return cluster
} catch (error) {
Error(error)
}
}
// Calling function
const cluster = await eks.createEksCluster(networking)
// Combining output into usable inputs for other modules
const composite = pulumi.all([
cluster.kubeconfig,
cluster.provider,
cluster.core.instanceProfile
]).apply(([
kubeconfig,
provider,
instanceProfile
]) => {
return {
kubeconfig: kubeconfig,
provider: provider,
instanceProfile: instanceProfile
}
})
broad-helmet-79436
11/05/2019, 9:08 AMmost-parrot-35986
11/05/2019, 9:16 AMtry catch
locally and still don't get any errors. CI, however, gets that error all the timewhite-balloon-205
async/await
here is. But indeed since you are catching the error and not returning anything in the catch
clause - this function will return undefined
if there is an error. You could rethrow it, or console.log
it, to see what the error is? (or could just remove all the `async`/`await` here - which I don't think is actually doing anything?)most-parrot-35986
11/05/2019, 6:49 PM