-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Cannot read properties of undefined (reading 'map') - eks cluster with 2 managed node groups #1202
Comments
@jamesongithub Apologies that you're facing this. I was able to reproduce on my end. It seems like the error is coming from https://github.com/pulumi/pulumi-eks/blame/c95cf4402c8d3c1f71440c566a0b3d8caa2090b2/nodejs/eks/nodegroup.ts#L1662. Note, I did not encounter this error when running this in a typescript pulumi program. |
Hi @rquitales , Thanks for reproducing. I can't tell from that stack trace. A node role arn was passed to both node groups. Seems like that condition should pass? thanks |
@jamesongithub After looking at the repro code in more detail, it looks like you are missing declaring the node role within your cluster's instance roles. Here is a python example which demonstrates this:
When updating the code you provided, I can successfully create the managed node groups: eks_cluster = eks.Cluster("eks-cluster",
# Put the cluster in the new VPC created earlier
vpc_id=eks_vpc.vpc_id,
# Public subnets will be used for load balancers
public_subnet_ids=eks_vpc.public_subnet_ids,
# Private subnets will be used for cluster nodes
private_subnet_ids=eks_vpc.private_subnet_ids,
# Change configuration values to change any of the following settings
# Do not give worker nodes a public IP address
node_associate_public_ip_address=False,
# Change these values for a private cluster (VPN access required)
endpoint_private_access=False,
endpoint_public_access=True,
skip_default_node_group=True,
instance_roles=[node_role],
)
# ... rest of code This is necessary because the nodegroup role needs to be set on the cluster to ensure that the I'll keep this issue open however, since we can better handle the |
Ok, thanks, Ill test it out. It actually doesn't mention it as a prerequisite here: https://docs.aws.amazon.com/eks/latest/userguide/create-managed-node-group.html Might be helpful to have a check on eks_cluster like there is on the managed_node_groups like you had referenced if it's a required attribute. (I'm unclear if it's needed only if you use managed node groups or not) |
@rquitales I added just the node role only and it did not work. i had to change this reference from
both changes, the node role in eks_cluster and this eks_cluster reference was required to deploy successfully |
Thanks for the updates and further investigation - I'll look into why |
### Proposed changes Adds an `undefined` guard before attempting to use `.map()`. This is due to MLC programs being able to send `undefined` instead of an empty array. This PR also updates the error handling to throw `pulumi.ResourceError` instead of a generic nodejs error. ### Related issues (optional) Fixes: #1202
### Proposed changes Adds an `undefined` guard before attempting to use `.map()`. This is due to MLC programs being able to send `undefined` instead of an empty array. This PR also updates the error handling to throw `pulumi.ResourceError` instead of a generic nodejs error. ### Related issues (optional) Fixes: #1202
What happened?
trying to create eks cluster with 2 managed node groups
Example
Output of
pulumi about
Additional context
stack trace
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).
The text was updated successfully, but these errors were encountered: