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

eks-blueprint : Error removing tag(s) from EKS cluster. #1110

Open
narmada-chittem opened this issue Feb 4, 2025 · 0 comments
Open

eks-blueprint : Error removing tag(s) from EKS cluster. #1110

narmada-chittem opened this issue Feb 4, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@narmada-chittem
Copy link

Describe the bug

Hello There!!

I’m facing an issue while removing tag(s) for an eks cluster.

Example code showing the tags being passed to the cluster provider -

return new FargateClusterProvider({
      version: kubernetesVersion,
      clusterName: this.props.clusterName,
      fargateProfiles: this.getFargateProfiles(),
      tags: this.props.tags,
      vpcSubnets: getFargatePrivateAndPublicSubnetSelection(this.props.vpc),
    });

Expected Behavior

We should be able to remove tags from the cluster.

Current Behavior

Problem:
I have an eks cluster with the following tags -

{
“tag1”: “tag1”,
“tag2”:”tag2”,
“tag3”:”tag3”,
“tag4”:”tag4”,
“tag5”:”tag5”,
“tag6”:”tag6”
}

When I try to remove a tag lets say “tag6”, my this.props.tags object looks like -

{
“tag1”: “tag1”,
“tag2”:”tag2”,
“tag3”:”tag3”,
“tag4”:”tag4”,
“tag5”:”tag5”,
}

While deploying I get the following error -
2025-01-07T08:14:45.961Z 89eb2daf-7e59-4f2d-b58c-2c268e9e611d ERROR Invoke Error
{
"errorType": "BadRequestException",
"errorMessage": "Invalid request input, expected non-empty tags map",
"name": "BadRequestException",
"$fault": "client",
"$metadata": {
"httpStatusCode": 400,
"requestId": "90e30715-8c18-4f65-98c7-a460779f31a2",
"attempts": 1,
"totalRetryDelay": 0
},
"stack": [
"BadRequestException: Invalid request input, expected non-empty tags map",
" at de_BadRequestExceptionRes (/var/runtime/node_modules/@aws-sdk/client-eks/dist-cjs/index.js:2559:21)",
" at de_CommandError (/var/runtime/node_modules/@aws-sdk/client-eks/dist-cjs/index.js:2522:19)",
" at process.processTicksAndRejections (node:internal/process/task_queues:95:5)",
" at async /var/runtime/node_modules/@aws-sdk/node_modules/@smithy/middleware-serde/dist-cjs/index.js:35:20",
" at async /var/runtime/node_modules/@aws-sdk/node_modules/@smithy/core/dist-cjs/index.js:165:18",
" at async /var/runtime/node_modules/@aws-sdk/node_modules/@smithy/middleware-retry/dist-cjs/index.js:320:38",
" at async /var/runtime/node_modules/@aws-sdk/middleware-logger/dist-cjs/index.js:34:22",
" at async tB.onUpdate (/var/task/index.js:63:10564)"
]
}

The error shows that empty tags are being passed but that is not the case. The tags are being passed correctly but this issue comes only when I do not pass all the tags that are already present on the cluster as mentioned in the above example.

Adding a new tag do not cause any issue -

{
“tag1”:“tag1”,
“tag2”:”tag2”,
“tag3”:”tag3”,
“tag4”:”tag4”,
“tag5”:”tag5”,
“tag6”:”tag6”,
“tag7”:”tag7”,
}

Passing a completely new set of tags does not cause any issue either. The existing tags get removed and the new tags get added.

{
“tag8”:“tag8”,
“tag9”:”tag9”,
}

Reproduction Steps

A. Create a cluster with some tags

const existingTags = {
“tag1”: “tag1”,
“tag2”:”tag2”,
“tag3”:”tag3”,
“tag4”:”tag4”,
“tag5”:”tag5”,
“tag6”:”tag6”
}
return new FargateClusterProvider({
      version: kubernetesVersion,
      clusterName: this.props.clusterName,
      fargateProfiles: this.getFargateProfiles(),
      tags: existingTags,
      vpcSubnets: getFargatePrivateAndPublicSubnetSelection(this.props.vpc),
    });

B. Remove a tag and redeploy the app

const updatedTags = {
“tag1”: “tag1”,
“tag2”:”tag2”,
“tag3”:”tag3”,
“tag4”:”tag4”,
“tag5”:”tag5”,
}
return new FargateClusterProvider({
      version: kubernetesVersion,
      clusterName: this.props.clusterName,
      fargateProfiles: this.getFargateProfiles(),
      tags: updatedTags,
      vpcSubnets: getFargatePrivateAndPublicSubnetSelection(this.props.vpc),
    });

Possible Solution

No response

Additional Information/Context

Request:
I am looking for a way to remove an existing tag present on the cluster.

CDK CLI Version

2.141.0

EKS Blueprints Version

1.15.1

Node.js Version

v18.16.0

Environment details (OS name and version, etc.)

MacOs

Other information

No response

@narmada-chittem narmada-chittem added the bug Something isn't working label Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant