pulumi / pulumi-eks

A Pulumi component for easily creating and managing an Amazon EKS Cluster
https://www.pulumi.com/registry/packages/eks/
Apache License 2.0
168 stars 76 forks source link

Build broken due to ClusterInternal import in addon.ts #1205

Closed chasinglogic closed 1 week ago

chasinglogic commented 1 week ago

What happened?

After upgrading to version 2.7.0 and 2.7.1 our typescript compiles are now broken for this package:

../../node_modules/@pulumi/eks/addon.d.ts:3:19 - error TS2305: Module '"./cluster"' has no exported member 'ClusterInternal'.

3 import { Cluster, ClusterInternal } from "./cluster";
                    ~~~~~~~~~~~~~~~

Found 1 error.

npm ERR! Lifecycle script `build` failed with error:
npm ERR! Error: command failed
npm ERR!   in workspace: aws-lbc
npm ERR!   at location: /Users/mathewrobinson/Work/platform/tillo-iac/infrastructure/aws-lbc

Example

Any clean build for any of our packages which rely on version 2.7.0 have this error. So simply compile against it and you should see the same.

It looks like ClusterInternal is exported in the cluster.ts file but in the resulting cluster.d.ts file the symbol is entirely absent:

~/Work/platform/tillo-iac/node_modules/@pulumi/eks task/debug-node-group λ grep ClusterInternal addon.d.ts
import { Cluster, ClusterInternal } from "./cluster";
    cluster: Cluster | ClusterInternal;
[kube: production]
~/Work/platform/tillo-iac/node_modules/@pulumi/eks task/debug-node-group λ grep ClusterInternal cluster.d.ts
[kube: production]
!! ~/Work/platform/tillo-iac/node_modules/@pulumi/eks task/debug-node-group λ

Output of pulumi about

CLI
Version 3.120.0 Go Version go1.22.4 Go Compiler gc

Plugins KIND NAME VERSION language nodejs unknown

Host
OS darwin Version 14.4.1 Arch arm64

This project is written in nodejs: executable='/Users/mathewrobinson/.local/share/mise/installs/node/lts/bin/node' version='v20.12.2'

Current Stack: organization/eks/dev

TYPE URN pulumi:pulumi:Stack urn:pulumi:dev::eks::pulumi:pulumi:Stack::eks-dev pulumi:providers:aws urn:pulumi:dev::eks::pulumi:providers:aws::subaccount-provider pulumi:providers:aws urn:pulumi:dev::eks::pulumi:providers:aws::internal-services-provider pulumi:providers:pulumi urn:pulumi:dev::eks::pulumi:providers:pulumi::default pulumi:providers:aws urn:pulumi:dev::eks::pulumi:providers:aws::root-provider pulumi:pulumi:StackReference urn:pulumi:dev::eks::pulumi:pulumi:StackReference::organization/vpc/dev pulumi:pulumi:StackReference urn:pulumi:dev::eks::pulumi:pulumi:StackReference::organization/system-internal-services/internal-services eks:index:Cluster urn:pulumi:dev::eks::eks:index:Cluster::dev-tillo-platform aws:ec2/securityGroup:SecurityGroup urn:pulumi:dev::eks::aws:ec2/securityGroup:SecurityGroup::dev-tillo-platform-eks-cluster-security-group aws:ec2/securityGroupRule:SecurityGroupRule urn:pulumi:dev::eks::aws:ec2/securityGroupRule:SecurityGroupRule::dev-tillo-platform-allow-ingress-to-eks-from-172.16.0.0/16 aws:ec2/securityGroupRule:SecurityGroupRule urn:pulumi:dev::eks::aws:ec2/securityGroupRule:SecurityGroupRule::dev-tillo-platform-allow-eks-access-to-itself eks:index:ServiceRole urn:pulumi:dev::eks::eks:index:Cluster$eks:index:ServiceRole::dev-tillo-platform-eksRole eks:index:ServiceRole urn:pulumi:dev::eks::eks:index:Cluster$eks:index:ServiceRole::dev-tillo-platform-instanceRole aws:ec2/securityGroupRule:SecurityGroupRule urn:pulumi:dev::eks::aws:ec2/securityGroupRule:SecurityGroupRule::dev-tillo-platform-allow-ingress-to-eks-from-10.102.0.0/16 aws:ec2/securityGroupRule:SecurityGroupRule urn:pulumi:dev::eks::aws:ec2/securityGroupRule:SecurityGroupRule::dev-tillo-platform-allow-ingress-to-eks-from-10.100.0.0/16 aws:ec2/securityGroupRule:SecurityGroupRule urn:pulumi:dev::eks::aws:ec2/securityGroupRule:SecurityGroupRule::dev-tillo-platform-allow-ingress-to-eks-from-10.103.0.0/16 aws:ec2/securityGroupRule:SecurityGroupRule urn:pulumi:dev::eks::aws:ec2/securityGroupRule:SecurityGroupRule::dev-tillo-platform-allow-ingress-to-eks-from-10.99.0.0/16 aws:ec2/securityGroupRule:SecurityGroupRule urn:pulumi:dev::eks::aws:ec2/securityGroupRule:SecurityGroupRule::dev-tillo-platform-allow-ingress-to-eks-from-10.101.0.0/16 aws:ec2/securityGroupRule:SecurityGroupRule urn:pulumi:dev::eks::aws:ec2/securityGroupRule:SecurityGroupRule::dev-tillo-platform-allow-ingress-to-eks-from-35.210.139.218/32 aws:ec2/securityGroupRule:SecurityGroupRule urn:pulumi:dev::eks::aws:ec2/securityGroupRule:SecurityGroupRule::dev-tillo-platform-group-allow-egress-to-internet-from-eks aws:iam/role:Role urn:pulumi:dev::eks::eks:index:Cluster$eks:index:ServiceRole$aws:iam/role:Role::dev-tillo-platform-eksRole-role aws:iam/role:Role urn:pulumi:dev::eks::eks:index:Cluster$eks:index:ServiceRole$aws:iam/role:Role::dev-tillo-platform-instanceRole-role aws:iam/rolePolicyAttachment:RolePolicyAttachment urn:pulumi:dev::eks::eks:index:Cluster$eks:index:ServiceRole$aws:iam/rolePolicyAttachment:RolePolicyAttachment::dev-tillo-platform-eksRole-4b490823 aws:iam/rolePolicyAttachment:RolePolicyAttachment urn:pulumi:dev::eks::eks:index:Cluster$eks:index:ServiceRole$aws:iam/rolePolicyAttachment:RolePolicyAttachment::dev-tillo-platform-instanceRole-e1b295bd aws:iam/rolePolicyAttachment:RolePolicyAttachment urn:pulumi:dev::eks::eks:index:Cluster$eks:index:ServiceRole$aws:iam/rolePolicyAttachment:RolePolicyAttachment::dev-tillo-platform-instanceRole-3eb088f2 aws:iam/rolePolicyAttachment:RolePolicyAttachment urn:pulumi:dev::eks::eks:index:Cluster$eks:index:ServiceRole$aws:iam/rolePolicyAttachment:RolePolicyAttachment::dev-tillo-platform-instanceRole-03516f97 aws:eks/cluster:Cluster urn:pulumi:dev::eks::eks:index:Cluster$aws:eks/cluster:Cluster::dev-tillo-platform-eksCluster aws:ec2/securityGroup:SecurityGroup urn:pulumi:dev::eks::eks:index:Cluster$aws:ec2/securityGroup:SecurityGroup::dev-tillo-platform-nodeSecurityGroup aws:eks/accessEntry:AccessEntry urn:pulumi:dev::eks::eks:index:Cluster$aws:eks/accessEntry:AccessEntry::dev-tillo-platform-defaultNodeGroupInstanceRole aws:ec2/securityGroupRule:SecurityGroupRule urn:pulumi:dev::eks::aws:ec2/securityGroupRule:SecurityGroupRule::allow-worker-nodes-to-access-the-cluster aws:ec2/securityGroupRule:SecurityGroupRule urn:pulumi:dev::eks::eks:index:Cluster$aws:ec2/securityGroupRule:SecurityGroupRule::dev-tillo-platform-eksNodeInternetEgressRule aws:ec2/securityGroupRule:SecurityGroupRule urn:pulumi:dev::eks::eks:index:Cluster$aws:ec2/securityGroupRule:SecurityGroupRule::dev-tillo-platform-eksExtApiServerClusterIngressRule aws:ec2/securityGroupRule:SecurityGroupRule urn:pulumi:dev::eks::eks:index:Cluster$aws:ec2/securityGroupRule:SecurityGroupRule::dev-tillo-platform-eksNodeClusterIngressRule aws:ec2/securityGroupRule:SecurityGroupRule urn:pulumi:dev::eks::eks:index:Cluster$aws:ec2/securityGroupRule:SecurityGroupRule::dev-tillo-platform-eksClusterIngressRule aws:ec2/securityGroupRule:SecurityGroupRule urn:pulumi:dev::eks::eks:index:Cluster$aws:ec2/securityGroupRule:SecurityGroupRule::dev-tillo-platform-eksNodeIngressRule aws:iam/openIdConnectProvider:OpenIdConnectProvider urn:pulumi:dev::eks::eks:index:Cluster$aws:iam/openIdConnectProvider:OpenIdConnectProvider::dev-tillo-platform-oidcProvider pulumi:providers:eks urn:pulumi:dev::eks::pulumi:providers:eks::default pulumi:providers:kubernetes urn:pulumi:dev::eks::eks:index:Cluster$pulumi:providers:kubernetes::dev-tillo-platform-eks-k8s eks:index:ManagedNodeGroup urn:pulumi:dev::eks::eks:index:ManagedNodeGroup::dev-tillo-platform-managed-node-group pulumi:providers:kubernetes urn:pulumi:dev::eks::eks:index:Cluster$pulumi:providers:kubernetes::dev-tillo-platform-provider aws:ec2/launchTemplate:LaunchTemplate urn:pulumi:dev::eks::aws:ec2/launchTemplate:LaunchTemplate::dev-tillo-platform-managed-node-launch-template eks:index:VpcCni urn:pulumi:dev::eks::eks:index:Cluster$eks:index:VpcCni::dev-tillo-platform-vpc-cni kubernetes:core/v1:ConfigMap urn:pulumi:dev::eks::eks:index:Cluster$kubernetes:core/v1:ConfigMap::dev-tillo-platform-nodeAccess aws:eks/nodeGroup:NodeGroup urn:pulumi:dev::eks::eks:index:ManagedNodeGroup$aws:eks/nodeGroup:NodeGroup::dev-tillo-platform-managed-node-group

Found no pending operations associated with dev

Backend
Name TL-C34J2FCC2Q URL s3://tillo-pulumi-state User mathewrobinson Organizations
Token type personal

Pulumi locates its logs in /var/folders/nq/w2ndy3fd66s9w2jhk3yt_psh0000gp/T/ by default

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

rquitales commented 1 week ago

@chasinglogic Apologies that you're encountering this error. Would you be able to provide additional information about how this error is triggered? I'm currently unable to reproduce this.

These are the following steps I've done:

mkdir test-eks
cd test-eks
pulumi new kubernetes-aws-typescript
pulumi preview

I'm able to successfully create the required resources.

chasinglogic commented 1 week ago

@rquitales if you run tsc after following your instructions you get the same result:

tmp/test-eks λ tsc
node_modules/@pulumi/eks/addon.d.ts:3:19 - error TS2305: Module '"./cluster"' has no exported member 'ClusterInternal'.

3 import { Cluster, ClusterInternal } from "./cluster";
                    ~~~~~~~~~~~~~~~

Found 1 error in node_modules/@pulumi/eks/addon.d.ts:3

[kube: production] [stack: dev]
!! /tmp/test-eks λ
chasinglogic commented 1 week ago

I don't know how pulumi is running the typescript without compiling it but we run tsc as part of our CI to validate correctness in our code before merging and deploying.

rquitales commented 1 week ago

Thanks for the additional info here! We'll look into addressing this.

chasinglogic commented 1 week ago

Thanks @rquitales