[ECS] [request]: scheduled fargate task with internet access
- Dominant language
- Shell
- Stars
- 5.4k
- Forks
- 334
- PR merge metrics
- No merged PRs in 30d
Description
**Tell us about your request**
I want to be able to create Fargate Scheduled Tasks with access to internet.
**Which service(s) is this request for?**
Fargate, ECS, Scheduled Tasks
**Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?**
I have several "cron jobs", that I want to start once a week and pull some data from internet, process them and store them in our DB/S3.
This is annoying - not being able to pull the image from our gitlab registry. But I suppose it can be fixed by using ECR. I'm not happy about it, but this I can work with.

But what is a big major problem is not being able to access the internet from within the container.
I've read the documentation and I understand why this doesn't work. But I don't understand why did you create it this way. It is the same problem as Lambda. You have to have NAT Gateway otherwise it doesn't work. But NAT Gateway is charged by the hour with additional enourmous cost for traffic. Now factor in the fact, that Fargate is at least twice as expensive as EC2 and it's suddenly cheaper to keep doing it manually.
This could be solved by allowing to assign a public IP to the scheduled task, the same way it is allowed when launching a task manually.

**Are you currently working around this issue?**
I start manually EC2 instances, then my task, after the task finishes I kill the EC2 instances.
I'm also considering using lambda, that would start the task with enabled public IP, and trigger this lambda using CloudWatch timer. It's a hassle, because I'll have to do it indirectly, instead of just configuring the scheduled task.
Contributor guide
Research direction
The issue names Fargate Scheduled Tasks, ECS, NAT Gateway, ECR, Lambda, and CloudWatch timers, but no repository files or tests. Start by tracing how scheduled tasks differ from manually launched tasks with public IP access; done means a scheduled task can reach the internet without requiring a NAT Gateway.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws
- Domain
- cloud
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 30/100