You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 14, 2022. It is now read-only.
The resource cannot both declare a volume and still support FARGATE (or non-volume EC2).
This is the specific instance of a general problem with the module/source approach. The upstream code cannot conditionally include any structured block¹ (of which there are hundreds in terraform AWS options). That's by design, since the HCL would no longer be structurally declarative.
Because we would need a copy-paste ECS-with-volume version of the same code, I don't see how this approach can become sufficiently flexible or reusable.
¹ I presume we really don't want to go the way of count/string_to_bool/regex hacks, but even that doesn't really solve this.
The text was updated successfully, but these errors were encountered:
Slack discussion expressed consensus that this service cannot do both, so will need to be replicated/forked. Note: these use cases would each require their own separate module:
ECS Fargate
ECS EC2 w/ 1 volume
ECS EC2 w/ 2 volumes
etc.
Each of those would require additional different modules in an n-dimensional matrix with every other block that might be configured in the underlying resources. Need a second port exposed? ECS EC2 w/ 3 volumes 2 ports. Need two security groups? Etc.
While the current approach might be amenable to copy/paste/modify for 2 projects, it certainly won't scale to 20.
https://github.com/sul-dlss/terraform-module-aws-ecs/blob/master/service/main.tf#L169
The
resource
cannot both declare avolume
and still support FARGATE (or non-volume EC2).This is the specific instance of a general problem with the
module
/source
approach. The upstream code cannot conditionally include any structured block¹
(of which there are hundreds in terraform AWS options). That's by design, since the HCL would no longer be structurally declarative.Because we would need a copy-paste ECS-with-volume version of the same code, I don't see how this approach can become sufficiently flexible or reusable.
¹
I presume we really don't want to go the way ofcount
/string_to_bool/regex hacks, but even that doesn't really solve this.The text was updated successfully, but these errors were encountered: