https://pulumi.com logo
#aws
Title
# aws
k

kind-carpenter-52856

01/27/2022, 7:14 PM
Guys, anyone know how to get oidcProvider arn and url, i use package @pulumi/eks (typescript)
Copy code
const cluster = new eks.Cluster("my-cluster", {
    skipDefaultNodeGroup: true,
    vpcId: vpc.id,
    publicSubnetIds: vpc.publicSubnetIds,
    privateSubnetIds: vpc.privateSubnetIds,
    instanceRoles: [role],
    createOidcProvider: true
});
export const oidcProvider = cluster.core.oidcProvider.arn
if try to execute i got this message
index.ts(61,29): error TS2532: Object is possibly 'undefined'.
l

little-cartoon-10569

01/27/2022, 7:56 PM
The docs aren't clear, are they? I'd try just telling TS that oidcProvider really is there.
export const oidcProviderArn = cluster.core.oidcProvider!.arn;
Hopefully oidcProvider is not undefined when createOidcProvider is true. That makes sense to me.
k

kind-carpenter-52856

01/28/2022, 3:56 AM
@little-cartoon-10569 OMG itโ€™s works, thx a lot for your answer
๐ŸŽ‰ 1
๐Ÿ‘ 1
27 Views