-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feat(eks): cluster tagging (#4995) #18109
Conversation
a96c34c
to
53095f5
Compare
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
@choryuidentify This doesn't really apply tags on the cluster itself... Also, I'm not seeing Edit: I'm using 2.8.0. Let me check if this functionality got ported to cdk 2.x really quick. Edit 2: Yep... it did in 2.7.0. |
I tested it now with aws-cdk 2.8.0 new eks.Cluster(this, 'test-cluster', {
version: KubernetesVersion.V1_21,
tags: {
"foo": "bar"
}
}) ...and looks good (I didn't deploy this but synth it) testcluster29C11904:
Type: Custom::AWSCDK-EKS-Cluster
Properties:
ServiceToken:
Fn::GetAtt:
- awscdkawseksClusterResourceProviderNestedStackawscdkawseksClusterResourceProviderNestedStackResource9827C454
- Outputs.SampleStackawscdkawseksClusterResourceProviderframeworkonEvent06FEB728Arn
Config:
version: "1.21"
roleArn:
Fn::GetAtt:
- testclusterRoleF0736E25
- Arn
resourcesVpcConfig:
subnetIds:
- Ref: testclusterDefaultVpcPublicSubnet1Subnet0CB1FE0A
- Ref: testclusterDefaultVpcPublicSubnet2Subnet2D94C923
- Ref: testclusterDefaultVpcPrivateSubnet1Subnet570845A0
- Ref: testclusterDefaultVpcPrivateSubnet2Subnet7AFA8EC9
securityGroupIds:
- Fn::GetAtt:
- testclusterControlPlaneSecurityGroupC4E3812B
- GroupId
endpointPublicAccess: true
endpointPrivateAccess: true
tags:
foo: bar
|
@choryuidentify I'm using cdk 2.8.0 ... and I'm seeing tags being propagated to |
I tested it using CDK 2.8.0. It deployed with tags successfully. **EDIT: sorry, I misunderstood. CDK 2 was completely changed dependencies path. I don't get it. It looks not an issue of this patch. package.json {
"name": "testcdk",
"version": "0.1.0",
"bin": {
"testcdk": "bin/testcdk.js"
},
"scripts": {
"build": "tsc",
"watch": "tsc -w",
"test": "jest",
"cdk": "cdk"
},
"devDependencies": {
"@types/jest": "^26.0.10",
"@types/node": "10.17.27",
"aws-cdk": "2.8.0",
"jest": "^26.4.2",
"ts-jest": "^26.2.0",
"ts-node": "^9.0.0",
"typescript": "~3.9.7"
},
"dependencies": {
"aws-cdk-lib": "2.8.0",
"constructs": "^10.0.0"
}
} testcdk-stack.ts import { Stack, StackProps } from 'aws-cdk-lib';
import * as eks from 'aws-cdk-lib/aws-eks';
import { KubernetesVersion } from 'aws-cdk-lib/aws-eks';
import { Construct } from 'constructs';
export class TestcdkStack extends Stack {
constructor(scope: Construct, id: string, props?: StackProps) {
super(scope, id, props);
new eks.Cluster(this, "testCluster", {
version: KubernetesVersion.V1_21,
defaultCapacity: 0,
tags: {
"foo": "bar",
"and": "more",
'other': 'tags'
}
})
}
} |
I’m using projen. But I’ll try using CDK directly. Also I noticed in your
package.json you’re using 2.8.0 for CDK and and 1.139.0 for eks module.
…On Tue, Jan 18, 2022 at 5:54 PM Choryu Park ***@***.***> wrote:
@choryuidentify <https://github.com/choryuidentify> I'm using cdk 2.8.0
... and I'm seeing tags being propagated to Custom::AWSCDK-EKS-Cluster.
Given that tags are supported on AWS::EKS::Cluster
<https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-eks-cluster.html>...
something tells me that the custom resource doesn't propagate them properly.
I tested it latest CDK and library. It deployed with tags successfully.
Please double check your ***@***.***/aws-eks' version inside NPM
'package.json'.
CDK version and other module's version are can be different, because
module versions are not following CDK version.
package.json
{
"name": "testcdk",
"version": "0.1.0",
"bin": {
"testcdk": "bin/testcdk.js"
},
"scripts": {
"build": "tsc",
"watch": "tsc -w",
"test": "jest",
"cdk": "cdk"
},
"devDependencies": {
***@***.***/aws-eks": "^1.139.0",
***@***.***/jest": "^26.0.10",
***@***.***/node": "10.17.27",
"aws-cdk": "2.8.0",
"jest": "^26.4.2",
"ts-jest": "^26.2.0",
"ts-node": "^9.0.0",
"typescript": "~3.9.7"
},
"dependencies": {
"aws-cdk-lib": "2.8.0",
"constructs": "^10.0.0"
}
}
testcdk-stack.ts
import { Stack, StackProps } from 'aws-cdk-lib';import * as eks from 'aws-cdk-lib/aws-eks';import { KubernetesVersion } from 'aws-cdk-lib/aws-eks';import { Construct } from 'constructs';
export class TestcdkStack extends Stack {
constructor(scope: Construct, id: string, props?: StackProps) {
super(scope, id, props);
new eks.Cluster(this, "testCluster", {
version: KubernetesVersion.V1_21,
defaultCapacity: 0,
tags: {
"foo": "bar",
"and": "more",
'other': 'tags'
}
})
}}
Result
<https://camo.githubusercontent.com/d40fabc631d5a17a247cbad901c40bba34382e5e7419c8ae25529d1d344c36d1/68747470733a2f2f692e696d6775722e636f6d2f304d765855537a2e706e67>
—
Reply to this email directly, view it on GitHub
<#18109 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAHWN6OZHCK2MHY5ET3AVLUWYDVZANCNFSM5KO652GA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
@robertd Sorry, Please check my reply again in GitHub. I edited my message several times, and I removed wrong suggestion. |
Ah. That makes sense. :)
…On Tue, Jan 18, 2022 at 6:45 PM Choryu Park ***@***.***> wrote:
@robertd <https://github.com/robertd> Sorry, Please check my reply again
in GitHub. I edited my message several times, and I removed wrong
suggestion.
—
Reply to this email directly, view it on GitHub
<#18109 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAHWN572T3LDZCSR6N4ZGTUWYJR7ANCNFSM5KO652GA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@choryuidentify Must be something on my end, but I'm using 2.8.0 w/ projen. Thanks for your help btw. |
@choryuidentify tags started propagating after full cleanup... something got stale on my end. Thanks for your help again. |
Nice! |
Fixes #4995
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license