Skip to content
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-stepfunctions-tasks: Allow using a specific revision in EcsRunTask #23491

Assignees
Labels
@aws-cdk/aws-stepfunctions-tasks effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. good first issue Related to contributions. See CONTRIBUTING.md p2

Comments

@AdamJHall
Copy link

Describe the feature

Currently when defining a EcsRunTask you pass through a TaskDefinition however the resulting stepfunction only references the task definitions family and the step function will use the latest "Active" definition.

However I would like to specify a revision number so that I can reference older task definition versions. This does seem to be possible with the underlying cloudformation but not via CDK.

Use Case

I have one stack which defines the task definition and another stack that accepts that stack as a prop and deploys a step function using that task definition.

There will be multiple instances of the stepfunction stack and I want that stepfunctions created by those stacks to refer to that task definition that it was referencing at that point in time.

Proposed Solution

Something like the below would be ideal, where revisionNumber is optional to not break current behaviour.

const runTask = new EcsRunTask(this, "RunTask", {
    cluster,
    taskDefinition,
    revisionNumber: taskDefinition.revisionNumber,
    launchTarget: new EcsFargateLaunchTarget(),
});

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.43.1

Environment details (OS name and version, etc.)

Ubuntu 20.04

@AdamJHall AdamJHall added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Dec 29, 2022
@peterwoodworth
Copy link
Contributor

According to the API ref, we should specify the task definition with family:revision. Currently, we only specify family. It should be easy to append the revision here if specified, thanks for the request!

I am marking this issue as p2, which means that we are unable to work on this immediately.

We use +1s to help prioritize our work, and are happy to revaluate this issue based on community feedback. You can reach out to the cdk.dev community on Slack to solicit support for reprioritization.

Check out our contributing guide if you're interested in contributing yourself - there's a low chance the team will be able to address this soon but we can try to review a PR 🙂

@peterwoodworth peterwoodworth added good first issue Related to contributions. See CONTRIBUTING.md 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 Dec 30, 2022
@zorrofox
Copy link
Contributor

zorrofox commented Feb 5, 2023

I have a question about this requirement, because if we use different Revision Number for TaskDefinition there will be different TaskDefinition instance and how we can modified the EcsRunTask property taskDefinition?

@westhouseK
Copy link
Contributor

@peterwoodworth
May I work on it? I want to try it!
I'm going to fix TaskDefinition, is it ok?

@peterwoodworth
Copy link
Contributor

Yes, go ahead @westhouseK! Be sure to add unit and integration testing, and to follow the contributing guide I linked above!

@mergify mergify bot closed this as completed in #24226 Feb 28, 2023
mergify bot pushed a commit that referenced this issue Feb 28, 2023
I can specify revision number when we use `EcsRunTask`. According to [API referance](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RunTask.html#ECS-RunTask-request-taskDefinition), we can specify revision number.
I initially thought that `EcsTask` has to have this propety, but revision number can be specified only when we execute([ECS referance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#family)). So I fixed it like this.

Closes #23491

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment