I'm having a very hard time trying to understand how to mirror the native Terraform module instantiation structure I am used to in Terragrunt. Take the below Terraform structure that creates different instances of a sns topic module.
module "sns_topic" {
source = "terraform-aws-modules/sns/aws"
version = "~> 3.0"
name = "my-topic"
}
module "sns_topic_two" {
source = "terraform-aws-modules/sns/aws"
version = "~> 3.0"
name = "my-topic-two"
content_based_deduplication = true
}
module "sns_topic_three" {
source = "terraform-aws-modules/sns/aws"
version = "~> 3.0"
name = "my-topic-three"
http_success_feedback_role_arn = x
http_success_feedback_sample_rate = y
http_failure_feedback_role_arn = z
}
...
Any of the fields in the module itself could populate a given instance of that module.
I don't understand how to accomplish this in Terragrunt via their Inputs for cases where each instance of the module can vary by the fields uses. For example, in the sns module, you could have Topic A that uses content_based_deduplication
and topic B that uses lambda_success_feedback_role_arn
and topic C that uses entirely different fields, and you might have 100 different topics in the environment. In native Terraform you'd just instantiate each module as seen above. But how can you do this via Terragrunt?