Reputation: 119
Let's say that I'm creating an AWS ECS cluster with the help of a public or internal module that I cannot directly change. That module is creating, besides the ECS, let's say a couple of SGs, some alb, maybe an ACM cert, etc. It's all good BUT, for the sake of this problem, I don't like the SGs configs and would like to change them but the developer did not provide a var for that.
Is there a way for me to reference a particular SG(or any other resource) created by that module and then overwrite/change/replace its config?
Or do I have to create a PR in the repo of that module to add the necessary vars/changes?
Upvotes: 1
Views: 1138
Reputation: 74064
In Terraform it's the responsibility of a module author to decide the scope of that module and tailor its input variables and output values to meet that scope. There is no way to add additional customization capabilities to a module from the perspective of a caller, because that would then cause your customizations to be effectively a compatibility constraint on future changes to the module which the module author has no awareness of, and therefore cannot predict.
If a particular module doesn't meet your needs then your options are, unfortunately, much the same as they are for third-party libraries in most language ecosystems:
Upvotes: 2