https://pulumi.com logo
#typescript
Title
# typescript
c

crooked-knife-92853

03/03/2020, 5:20 PM
Hi there, is there any way to import an existing EKS cluster into Pulumi? I get an error when I try to use the
import
syntax as I have for other resources.
figured it out! I was trying to use the
@pulumi/eks
instead of the
@pulumi/aws
module.
Copy code
const existingEksCluster = aws.eks.getCluster({ name: clusterName });

new aws.eks.Cluster(
    clusterName,
    {
        roleArn: existingEksCluster.roleArn,
        enabledClusterLogTypes: existingEksCluster.enabledClusterLogTypes,
        vpcConfig: {
            subnetIds: existingEksCluster.vpcConfig.subnetIds,
            securityGroupIds: existingEksCluster.vpcConfig.securityGroupIds,
            endpointPrivateAccess: existingEksCluster.vpcConfig.endpointPrivateAccess,
            endpointPublicAccess: existingEksCluster.vpcConfig.endpointPublicAccess,
        },
    },
    { import: existingEksCluster.id },
);
👍 1