[ECS]: awsvpc Network Mode: Allow ENIs in subnets other than the host
- Dominant language
- Shell
- Stars
- 5.4k
- Forks
- 334
- PR merge metrics
- No merged PRs in 30d
Description
### Community Note
* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment
**Tell us about your request**
(In essence this is a duplicate of #49, I considered reopening it but it's already closed for 6 years so I figured it might be better to create a new one.)
I want to deploy my EC2 instances in vpc-A, subnet-A
I want to deploy my ECS tasks in vpc-B, subnet-B
Both subnet-A and subnet-B are in the **same** Availability zone.
The conclusion from issue #49 was: https://github.com/aws/containers-roadmap/issues/49#issuecomment-447114048
> The feature you proposed should already work today. The awsvpc task and the instance need not be in the same subnet, just in the same availability zone. You can launch awsvpc tasks to any subnet as long as there is at least one ECS instance in the same availability zone. Just to make sure, I just launched one myself and confirmed that it succeeds.
However that does not appear to be the case.
When deploying the above configuration the error message is:
> service ... was unable to place a task because no container instance met all of its requirements. The closest matching container-instance ... is missing an attribute required by your task. For more information, see the Troubleshooting section of the Amazon ECS Developer Guide.
Checking the knowledge center: https://repost.aws/knowledge-center/ecs-container-instance-requirement-error and running the `ecs-cli check-attributes` command:
```
$ ecs-cli check-attributes --task-def ... --container-instances ... --cluster ...
Container Instance Missing Attributes
........................... None
```
Again from the knowledge center link:
> You can configure an Amazon ECS service to run on a subnet that's different from the subnet for the container instance. In this case, the output of the ecs-cli-check-attributes command shows None for missing attributes, even though the task fails with the missing attribute error. The subnets for your service and the container instance must match.
Which to me appears in contradiction with the conclusion in issue #49
**Which service(s) is this request for?**
This could be ECS
Contributor guide
Assessment
This issue has not been assessed yet.