-
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(ecs): Implement method in ECS cluster to retrieve task ARN #28381
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
b714c68
to
d8864ff
Compare
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
c2c87dd
to
ea5d1b8
Compare
ca540a3
to
5b3d2a5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @badmintoncryer, a few comments on this PR. 1 is related to how you've implemented the arn, and the second is that the integ tests don't seem related. If you are interested in adding additional ecs integ tests, I would love that, but that should be part of a separate PR.
* @param keyPattern Task id pattern | ||
*/ | ||
public arnForTasks(keyPattern: string): string { | ||
return `arn:${Stack.of(this).partition}:ecs:${Stack.of(this).region}:${Stack.of(this).account}:task/${this.clusterName}/${keyPattern}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use our standard way of generating arns here. Something like this:
aws-cdk/packages/@aws-cdk/app-staging-synthesizer-alpha/lib/default-staging-stack.ts
Lines 304 to 311 in 8c44f32
this.fileRoleManifestArn = Stack.of(this).formatArn({ | |
partition: '${AWS::Partition}', | |
region: '', // iam is global | |
service: 'iam', | |
resource: 'role', | |
resourceName: roleName, | |
arnFormat: ArnFormat.SLASH_RESOURCE_NAME, | |
}); |
This means that many of the options we can just use the default (it automatically assumes that the partition/region/account will come from the stack)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much. I have learned a lot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see how this integ test is related to the feature added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same for this
5b3d2a5
to
94a6cc5
Compare
Pull request has been modified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
Exemption Request @kaizencc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @badmintoncryer!
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
Thank you for contributing! Your pull request will be updated from main 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 main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
…28381) This pull request introduces a new method within the Cluster class, designed to retrieve the Amazon Resource Names (ARNs) of tasks that are part of a given ECS cluster. Example of how to get task ARN ```ts declare cluster: Cluster; // arn:aws:ecs:{region}:{regionId}:task/{clusterName}/* const taskArnPattern = cluster.arnForTasks("*"); ``` Closes aws#26232 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This pull request introduces a new method within the Cluster class, designed to retrieve the Amazon Resource Names (ARNs) of tasks that are part of a given ECS cluster.
Example of how to get task ARN
Closes #26232
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license