-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
(aws-ecs): Give Cluster a method that provides task ARNs #26232
Labels
@aws-cdk/aws-ecs
Related to Amazon Elastic Container
effort/small
Small work item – less than a day of effort
feature-request
A feature should be added or improved.
p2
Comments
SamStephens
added
feature-request
A feature should be added or improved.
needs-triage
This issue or PR still needs to be triaged.
labels
Jul 5, 2023
2 tasks
Thanks for suggesting this feature @SamStephens , it would be a good and useful addition. |
khushail
added
p2
effort/small
Small work item – less than a day of effort
and removed
needs-triage
This issue or PR still needs to be triaged.
labels
Jul 5, 2023
mergify bot
pushed a commit
that referenced
this issue
Dec 22, 2023
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 #26232 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
paulhcsun
pushed a commit
to paulhcsun/aws-cdk
that referenced
this issue
Jan 5, 2024
…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*
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
@aws-cdk/aws-ecs
Related to Amazon Elastic Container
effort/small
Small work item – less than a day of effort
feature-request
A feature should be added or improved.
p2
Describe the feature
ARNs for tasks in a Cluster are in the form
arn:{partition}:ecs:{region}:{accountId}:task/{clusterName}/{taskId}
. It would be useful to have a method that can form these ARNs for you.The aws-s3 Bucket class provides prior art for this with its arnForObjects method.
I guess this method would be called
arnForTasks
.Use Case
In order to grant my task role permissions to the task protection API. My workaround is
With this method, the call would be
Proposed Solution
I'm not sure what best practice for forming ARNs within the CDK is, but using
formatArn
as I do in my example above would work.Other Information
See also my request for a grantTaskProtection method
Acknowledgements
CDK version used
2.85.0
Environment details (OS name and version, etc.)
Ubuntu (Windows Subsystem for Linux)
The text was updated successfully, but these errors were encountered: