-
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
aws_ecs_patterns: Allow setting containerName of ScheduledFargateTask and ScheduledEc2Task #30281
aws_ecs_patterns: Allow setting containerName of ScheduledFargateTask and ScheduledEc2Task #30281
Comments
Thanks @dleavitt for submitting this FR. |
… fargate tasks (#30357) ### Issue # (if applicable) Closes #30281 Closes #27515 ### Reason for this change The customers have difficulties to find the correct logs for some scheduled task if they have multiple tasks defined in the stack, as all tasks will use the same container name. ### Description of changes Add the new optional property `ContainerName` in the `ScheduledTaskImageProps`, so customer can use it to customize the containers names. If this property is undefined, so we will use `ScheduledContainer` as default value. ### Description of how you validated changes added unit and integration test cases, and verified them. ### Checklist - [X] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
… fargate tasks (aws#30357) ### Issue # (if applicable) Closes aws#30281 Closes aws#27515 ### Reason for this change The customers have difficulties to find the correct logs for some scheduled task if they have multiple tasks defined in the stack, as all tasks will use the same container name. ### Description of changes Add the new optional property `ContainerName` in the `ScheduledTaskImageProps`, so customer can use it to customize the containers names. If this property is undefined, so we will use `ScheduledContainer` as default value. ### Description of how you validated changes added unit and integration test cases, and verified them. ### Checklist - [X] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
… fargate tasks (aws#30357) ### Issue # (if applicable) Closes aws#30281 Closes aws#27515 ### Reason for this change The customers have difficulties to find the correct logs for some scheduled task if they have multiple tasks defined in the stack, as all tasks will use the same container name. ### Description of changes Add the new optional property `ContainerName` in the `ScheduledTaskImageProps`, so customer can use it to customize the containers names. If this property is undefined, so we will use `ScheduledContainer` as default value. ### Description of how you validated changes added unit and integration test cases, and verified them. ### Checklist - [X] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one. |
Describe the feature
Currently the container name for both of these constructs is hardcoded to "ScheduledContainer" and cannot be changed. The other constructs in this package accept a
containerName
parameter.aws-cdk/packages/aws-cdk-lib/aws-ecs-patterns/lib/ecs/scheduled-ecs-task.ts
Line 108 in e4e8361
aws-cdk/packages/aws-cdk-lib/aws-ecs-patterns/lib/fargate/scheduled-fargate-task.ts
Line 81 in e4e8361
Use Case
In the Cloudwatch logs, the stream name for ECS containers is always of the form:
prefix-name/container-name/ecs-task-id
The current behavior of these constructs means that the container-name will always be "ScheduledContainer", which is unhelpful if you have many scheduled tasks and are trying to find the right logs.
Proposed Solution
Allow passing a
containerName
as part of thetaskImageOptions
for these two constructs, as the other services in this package do.Other Information
No response
Acknowledgements
CDK version used
2.140.0 (build 46168aa)
Environment details (OS name and version, etc.)
MacOS 14.3
The text was updated successfully, but these errors were encountered: