moto icon indicating copy to clipboard operation
moto copied to clipboard

ECS run_task in fargate mode

Open shubozhang opened this issue 5 years ago • 7 comments

Is there a way to mock ecs run_task in fargate mode? Currently, I only find EC2 mode. Thanks !

shubozhang avatar Mar 11 '19 11:03 shubozhang

Thanks for opening.

Not today, but I am going to set this as a feature request.

spulec avatar Jul 09 '19 01:07 spulec

Seconding this!

FishmanL avatar Jun 08 '20 15:06 FishmanL

It's been a while since this request, just wondering if it's still on the roadmap? Thanks!

mracette avatar Apr 24 '21 17:04 mracette

Hi @mracette, moto is really a community-driven project, so there's no roadmap as such. Features just get added by people who want to contribute/really need that specific feature. So if somebody feels like developing this - PR's are always welcome!

bblommers avatar Apr 25 '21 13:04 bblommers

There's been quite some improvements to ECS since this was raised, including in #3584, and we do have internal tests that call run_task(launchType="FARGATE"), so I'm going to assume that this now works as intended.

I'll close this, but do let us know if there are still issues with our current implementation.

bblommers avatar Dec 27 '21 21:12 bblommers

@bblommers Unfortunately, it still doesn't work, I just faced the issue in 3.1.4 release.

The internal test calling run_task(launchType="FARGATE") actually registers instance before, so simulates EC2 launch type, not the Fargate launch. If you drop client.register_container_instance from the test, it will stop to work, as run_task assumes EC2 run. I think I can contribute a fix for this case.

szczeles avatar Apr 11 '22 13:04 szczeles

Hi @szczeles, thanks for letting us know. A PR would be very welcome - let me know if you need any help around this!

bblommers avatar Apr 11 '22 19:04 bblommers