aws-cloudformation / cloudformation-coverage-roadmap

The AWS CloudFormation Public Coverage Roadmap
https://aws.amazon.com/cloudformation/
Creative Commons Attribution Share Alike 4.0 International
1.11k stars 56 forks source link

[AWS:EKS:Nodegroup] - [BUG] - CloudControl sends invalid update request when using a Nodegroup with custom Launch Template #2151

Open flostadler opened 1 month ago

flostadler commented 1 month ago

Name of the resource

AWS::EKS::Nodegroup

Resource Name

No response

Issue Description

Users can customize EKS Nodegroups with launch templates (see AWS docs).

When setting a custom AMI in the launch template, the UpdateNodegroupVersion API call must not include the following properties (see AWS docs):

But CloudControl includes them. The consequence is that those node groups cannot be updated.

Expected Behavior

When the launch template associated with a node group sets a custom AMI, the UpdateNodegroupVersion API call should not include:

You can detect if a custom AMI is used in the launch template by checking the node groups amiType property. That one is set to CUSTOM in that case.

Observed Behavior

The CloudControl UpdateResource call fails:

{
    "ProgressEvent": {
        "TypeName": "AWS::EKS::Nodegroup",
        "Identifier": "eks-1747-8c81e17/managed-nodes-d526726",
        "RequestToken": "acd85058-a6a5-4858-80bd-8288d36839c1",
        "Operation": "UPDATE",
        "OperationStatus": "FAILED",
        "EventTime": "2024-10-02T13:27:15.678000+02:00",
        "StatusMessage": "You cannot specify the field releaseVersion when using custom AMIs. (Service: Eks, Status Code: 400, Request ID: f1b163cc-5732-419e-96cf-150fe1ea3184)",
        "ErrorCode": "InvalidRequest"
    }
}

Test Cases

I attached details about the node group and launch template configuration I was using so you can reproduce it: launch_template.json nodegroup.json

Other Details

No response

lynnnnnnluo commented 3 weeks ago

Hello, could you share your CloudControl templates before the update and used for update. It is possible the handler detects a change in both releaseVersion and launchTemplate.