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

Feature request: easy way to use a service’s task role when running a one-off task #1432

Open
aviflax opened this issue Sep 25, 2020 · 6 comments
Labels
size/M We should be able to deliver roughly 1 medium issue in a sprint. type/enhancement Issues that are improvements for existing features. type/request Issues that are created by customers.

Comments

@aviflax
Copy link

aviflax commented Sep 25, 2020

Right now I can see that a service has a task role, but I don’t see a way to programmatically and automatically get the ARN of that role and pass it to copilot task run — I need this to be dynamic because it will vary by environment, and I can’t have a manual step of retrieving the ARN.

It’d be great if there was a way to associate a one-off task with a service, just as we can currently associate it with an app and/or an environment; if so I think it’d be natural and intuitive that the one-off task would then use the task role of the service.

Alternatively, perhaps the task role ARN could be exported as a CloudFormation output, or put into an SSM param, so that I could retrieve it via a script using the AWS CLI.

(Right now I’m manually specifying a task role for one-off tasks in one of my add-ons, and then putting its ARN into an SSM param. That’s working, but it took me awhile to work it out, and it’s extra “noise” in my add-on template.)

Thank you!

@efekarakus efekarakus added type/enhancement Issues that are improvements for existing features. type/request Issues that are created by customers. labels Sep 25, 2020
@kohidave
Copy link
Contributor

I think it makes total sense to add a --svc flag to task run which will run with the service's task role.

@kohidave kohidave mentioned this issue Sep 25, 2020
9 tasks
@malkovro
Copy link

Would it make sense to run it with the env variable and secrets specified in the manifest for this service as well ?
I see the Task Run Design Command "issue"(#702) mentions that one of its use-case is to allow one-off scripts requiring secrets but there is no way to currently pass those secrets to the command.

@aviflax
Copy link
Author

aviflax commented Sep 29, 2020

Would it make sense to run it with the env variable and secrets specified in the manifest for this service as well ?

I think so, yes. I think that'd be intuitive and useful.

@efekarakus
Copy link
Contributor

Thanks for the feedback that makes a lot of sense!

@efekarakus efekarakus added the size/M We should be able to deliver roughly 1 medium issue in a sprint. label Nov 16, 2020
@efekarakus
Copy link
Contributor

Hi @malkovro @aviflax ! We have a proposal to support this feature (#2159) we would love to hear your feedback on the issue 😄

@aviflax
Copy link
Author

aviflax commented Apr 9, 2021

Sorry I’m not currently using Copilot, as it's not applicable to my current project. So I don't think I can give good feedback on the proposal. At a high level all the approaches look very promising though. Nice work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M We should be able to deliver roughly 1 medium issue in a sprint. type/enhancement Issues that are improvements for existing features. type/request Issues that are created by customers.
Projects
None yet
Development

No branches or pull requests

4 participants