Enable ECS Instances to run Tasks with IAM Roles#114
Enable ECS Instances to run Tasks with IAM Roles#114achille-roussel merged 3 commits intosegmentio:masterfrom
Conversation
This enables `ecs-agent` to place containers on ECS instances that have an associated IAM Role. If not present, `ecs-agent` will error with the following message: > service docker-demo-app was unable to place a task because no container instance met all of its requirements. The closest matching container-instance d4811e83-91a0-40bc-8250-9bb820ef6550 is missing an attribute required by your task.
|
@achille-roussel Still working on this! The iptables rules are causing some issues. |
…S Task IAM Role authentication
|
Okie doke, this is ready to go @achille-roussel! One minor note: if you run On the ECS-Optimized AMI, the I'm not sure the order is a huge deal, but if it is, let me know and I'll try to figure something out. I'm not sure we can get around changing the order without a) updating iptables in the |
|
Another few notes: Line 12: You'll notice on line 19 that we manually trigger saving the rules. If anyone else needs to make iptables changes, they'll need to run |
|
I don't deal with iptables on a daily basis so I couldn't tell you if netfilter-persistent is being used properly here. We have our private AMIs configured for ECS task roles at Segment and the rules show up in the same order that you have, so I assume it should be working just fine. Have you been able to test this? It should tell us pretty quickly if this is working or not. |
|
@achille-roussel yup, I was testing it as I was going. Can confirm roles are working. |
|
Awesome! I'm happy to merge those changes, thanks for your contribution, I'm sure this will be very useful to plenty of people! |
|
😄 Thanks for all of yours! |
This enables
ecs-agentto place containers on ECS instances that have an associated IAM Role. If not present,ecs-agentwill error with the following message: