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

[ECS] Support for Scheduled Tasks (cron) ECS Tasks #881

Closed
gregeinfrank opened this issue Jun 15, 2017 · 10 comments
Closed

[ECS] Support for Scheduled Tasks (cron) ECS Tasks #881

gregeinfrank opened this issue Jun 15, 2017 · 10 comments
Labels
enhancement Requests to existing resources that expand the functionality or scope.

Comments

@gregeinfrank
Copy link

gregeinfrank commented Jun 15, 2017

Hi,

Amazon recently announced the introduction of Scheduled ECS Tasks - which we would find very useful and prevent us from having to jump through hoops to get scheduled tasks to run on ECS

It would be awesome to be able to start creating these and managing them through Terraform. Sorry if this is a duplicate issue and thank you!

@radeksimko
Copy link
Member

Hi @gregeinfrank
I believe that the AWS Console UI steps mentioned in the dev guide are just covering existing API functionality which Terraform already supports. Specifically CloudWatch Events.

Have looked at https://www.terraform.io/docs/providers/aws/r/cloudwatch_event_target.html and other relevant resources? As far as I can see there's no new ECS API for "scheduled tasks". All you seem to need is ECS Task Definition + ECS cluster and CloudWatch Event Rule + CloudWatch Event Target + relevant IAM resources.

@radeksimko radeksimko added question A question about existing functionality; most questions are re-routed to discuss.hashicorp.com. waiting-response Maintainers are waiting on response from community or contributor. labels Jun 16, 2017
@gregeinfrank
Copy link
Author

@radeksimko I must have missed that - I will look into cloudwatch_event_target and see if I can schedule ECS tasks from there. Thanks

@anthonyagresta
Copy link

@radeksimko @gregeinfrank
I tried this today, and it looks like there's a new set of EcsParameters options that are required in order for your target to run an ECS task.
It needs to pass in the ECS cluster ARN for the regular Arn parameter, but there's a separate TaskDefinitionArn and TaskCount that need to be provided in EcsParameters to tell it what to run on that cluster.

Looking at the source and documentation, it doesn't look like the resource can send these in its current state.
It looks like it'd be really similar to how the run_command_targets argument works now.

JSON Syntax example in the AWS CLI docs: http://docs.aws.amazon.com/cli/latest/reference/events/put-targets.html

@anthonyagresta
Copy link

related: #871

@radeksimko
Copy link
Member

@anthonyagresta You're right, thanks for the effort in figuring out what's missing 👍

Re-labelling as enhancement. PRs welcomed 😉

@radeksimko radeksimko added enhancement Requests to existing resources that expand the functionality or scope. and removed question A question about existing functionality; most questions are re-routed to discuss.hashicorp.com. waiting-response Maintainers are waiting on response from community or contributor. labels Jun 21, 2017
@radeksimko
Copy link
Member

#977 was merged and will be part of the next release.

@theduke
Copy link

theduke commented Oct 10, 2017

@anthonyagresta I was struggling with the exact same thing (albeit in Ansible, not terraform), and your comment here helped me figure things out.

Big cheers for that!

@joshuamkite
Copy link
Contributor

So Amazon have just announced and released Amazon ECS Adds Daemon Scheduling. Please could we have support for this attribute in Terraform?

@thomasbiddle
Copy link
Contributor

@joshuamkite Sounds like that should be an entirely separate issue.

@ghost
Copy link

ghost commented Apr 4, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope.
Projects
None yet
Development

No branches or pull requests

6 participants