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

(stepfunctions-tasks): EcsRunTask does not have PropagateTags parameter #14553

Closed
2 tasks
metgrahamr opened this issue May 6, 2021 · 6 comments
Closed
2 tasks
Labels
@aws-cdk/aws-stepfunctions-tasks closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2

Comments

@metgrahamr
Copy link

The stepfunction service integration with ecs has the option of propagating tags to a task based on those applied to the task definition - docs. This option doesn't appear to be available when using EcsRunTask.

Use Case

Tagging individual tasks will allow better allocation of costs to internal projects.

Proposed Solution

Add the PropagateTags parameter as an option to EcsRunTask.

Other

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

This is a 🚀 Feature Request

@metgrahamr metgrahamr added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels May 6, 2021
@ericzbeard ericzbeard assigned BenChaimberg and unassigned shivlaks Jun 18, 2021
@BenChaimberg
Copy link
Contributor

BenChaimberg commented Jun 21, 2021

Workaround:

class ModifiedEcsRunTask extends sfntasks.EcsRunTask {
  constructor(scope: Construct, id: string, props: sfntasks.EcsRunTaskProps) {
    super(scope, id, props);
  }

  protected _renderTask(): any {
    const orig = super._renderTask()
    const ret = {};
    Object.assign(ret, orig, { Parameters: { PropagateTags: 'TASK_DEFINITION', ...orig.Parameters } });
    return ret;
  }
}

@BenChaimberg
Copy link
Contributor

I am unassigning myself and 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 reevaluate this issue based on community feedback. You can reach out to the cdk.dev community on Slack to solicit support for reprioritization. Please feel free to work on this issue yourself and request my review if you submit a PR or would like design help! See CONTRIBUTING.md for guidelines.

@BenChaimberg BenChaimberg added effort/small Small work item – less than a day of effort p2 and removed needs-triage This issue or PR still needs to be triaged. labels Jun 21, 2021
@BenChaimberg BenChaimberg removed their assignment Jun 21, 2021
@metgrahamr
Copy link
Author

Thanks for looking at this and also suggesting a workaround. I'm not familiar with TypeScript and jsii. Can I try a similar workaround with the Python source code directly or do I need to make the changes as above and somehow automatically generate the Python?

Another workaround that I have used elsewhere is to use the L2 construct to generate state JSON, add the required parameters and then create a custom state from the JSON. Unfortunately, in this case, I need to add things such as retries to the EcsRunTask object which aren't available to a custom state object.

@BenChaimberg
Copy link
Contributor

Not a Python expert, but here's the equivalent

class ModifiedEcsRunTask(sfntasks.EcsRunTask):
  def to_state_json(self):
    orig = super().to_state_json()
    ret = copy(orig)
    ret['Parameters']['PropagateTags'] = 'TASK_DEFINITION'
    return ret

@metgrahamr
Copy link
Author

Awesome, thank you. I will give that a try.

@github-actions
Copy link

This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-stepfunctions-tasks closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

No branches or pull requests

3 participants