aws / aws/aws-cdk

aws_events_targets: EcsTarget can't be set to latest revision

Open
#21,782 8 comments 0 reactions 0 assignees View on GitHub
@aws-cdk/aws-events-targets effort/small feature-request p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the bug

When creating a ECSTarget on a rule, I want the ECS Task to be set to the `latest` revision, not the specific number of the revision. By researching on the [ECS Target documentation](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_events_targets.EcsTask.html) I couldn't find a way to set this value, nor a property or parameter.

### Expected Behavior

When creating a ECSTarget on a rule, I would like to have a way to tell the ECSTask to use the `latest` revision, not the specific revision number.

### Current Behavior

When creating a ECSTarget on a rule, the ECSTask always takes the specific revision number of the deployment.

### Reproduction Steps

new targets.EcsTask({
cluster,
taskDefinition,
containerOverrides: [
{
containerName: container.containerName,
environment: [
{
name: "MEETING",
value: EventField.fromPath("$.detail.meetingId"),
},
],
},
],
})
);

### Possible Solution

Having a property, flag or some value to represent the `latest` tag on the ECSTask.

### Additional Information/Context

_No response_

### CDK CLI Version

2.13.0

### Framework Version

_No response_

### Node.js Version

16

### OS

Windows 10 Pro x64

### Language

Typescript

### Language Version

_No response_

### Other information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the aws_events_targets.EcsTask API and the linked ECS Target documentation, then reproduce the behavior using the TypeScript example in the issue. Determine how the target currently selects a task-definition revision and what supported representation of the latest revision is possible; done means the feature is documented and tested for the requested latest-revision behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.