Skip to content

aws_ecs_patterns: Allow setting containerName of ScheduledFargateTask and ScheduledEc2Task #30281

@dleavitt

Description

@dleavitt

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.

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 the taskImageOptions for these two constructs, as the other services in this package do.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.140.0 (build 46168aa)

Environment details (OS name and version, etc.)

MacOS 14.3

Metadata

Metadata

Assignees

Labels

@aws-cdk/aws-ecs-patternsRelated to ecs-patterns libraryeffort/mediumMedium work item – several days of effortfeature-requestA feature should be added or improved.p2

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions