Skip to content
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

InvalidParameterException: You cannot specify an AMI Type other than CUSTOM, when specifying an image id in your launch template #1463

Closed
victoroloan opened this issue Oct 28, 2024 · 3 comments · Fixed by #1464
Assignees
Labels
kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed

Comments

@victoroloan
Copy link

What happened?

Encountered an error stating that an AMI Type other than CUSTOM cannot be specified when providing an image ID. However, no launch template has been set in the configuration.

Error message: InvalidParameterException: You cannot specify an AMI Type other than CUSTOM, when specifying an image id in your launch template

Example

  const managedNodeGroup =  new eks.ManagedNodeGroup(
    "nodegroup-28102024",
    {
      cluster: cluster,
      nodeGroupName:  "managed-ng-28102024",
      amiType: "AL2023_ARM_64_STANDARD",
      instanceTypes: ["t3.large"],
      diskSize: 50,
      kubeletExtraArgs: "--max-pods=110", 
      scalingConfig: {
        desiredSize: 2,
        minSize: 1,
        maxSize: 3,
      },
    },
  );

Output of pulumi about

CLI          
Version      3.137.0
Go Version   go1.23.2
Go Compiler  gc

Plugins
KIND      NAME        VERSION
resource  aws         6.45.0
resource  awsx        2.13.0
resource  eks         3.0.0
resource  kubernetes  4.17.1
language  nodejs      unknown
resource  random      4.16.3

Host     
OS       darwin
Version  15.0.1
Arch     arm64

This project is written in nodejs: executable='/opt/homebrew/bin/node' version='v20.18.0'

Backend        
Name           myhostname
URL            s3://mys3bcuket
User           myuser
Organizations  
Token type     personal

Additional context

I encountered this issue - #1779 when using pulumi/eks version 2.7.8. I attempted to update to version 3.0 to resolve it, but then encountered the issue described above

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).

@victoroloan victoroloan added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Oct 28, 2024
@flostadler
Copy link
Contributor

Hey @victoroloan, sorry you're running into this issue! I was able to reproduce it and started working on a fix. AWS EKS requires that no ami type is set on the node group itself if an AMI ID is set in the launch template.

Using kubeletExtraArgs requires a custom launch template, because of that the provider creates one. So even though you're not specifying a launch template yourself, one needs to be created.

While I'm working on the fix, you can work around the issue by omitting the amiType and instead specifying the operatingSystem. The Provider will automatically choose the right AMI type in that case.

Example:

const managedNodeGroup = new eks.ManagedNodeGroup(
    "managed-ng",
    {
        cluster: eksCluster,
        operatingSystem: eks.OperatingSystem.AL2023,
        instanceTypes: ["t4g.large"],
        diskSize: 50,
        kubeletExtraArgs: "--max-pods=110",
        scalingConfig: {
            desiredSize: 2,
            minSize: 1,
            maxSize: 3,
        },
        nodeRole: role,
    },
);

@flostadler flostadler removed the needs-triage Needs attention from the triage team label Oct 28, 2024
@flostadler flostadler self-assigned this Oct 28, 2024
@pulumi-bot pulumi-bot added the resolution/fixed This issue was fixed label Oct 28, 2024
@flostadler
Copy link
Contributor

@victoroloan The fix was just merged in. I'll kick off a release right away

@pulumi-bot
Copy link
Contributor

This issue has been addressed in PR #1464 and shipped in release v3.0.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants