cn-terraform / terraform-aws-ecs-fargate

AWS ECS Fargate Terraform Module
https://registry.terraform.io/modules/cn-terraform/ecs-fargate
Apache License 2.0
87 stars 57 forks source link

Feature request: Add "enable" flag #17

Closed lukaszraczylo closed 3 years ago

lukaszraczylo commented 4 years ago

Objective: In some use cases users may not want any resources to be created ( essentially - skip the module ). This feature could be controlled by setting the enable = false flag.

jnonino commented 4 years ago

Hi, the module is composed by other modules. I should switch to Terraform 0.13 which was recently released but I didn't have the chance to test it yet. I'll add this feature as soon as I switch to Terraform 0.13

lukaszraczylo commented 4 years ago

@jnonino thank you so much! It's one of those times when you need to choose - either add the feature to all the dependent modules ( and allow 0.12 users to use it ) or wait for the 0.13 and hope that majority of users will be able to upgrade to 0.13 quickly enough :)

jnonino commented 3 years ago

Using Terraform 0.13 you can do something like this:

module "ecs-fargate" {
  count = var.boolean_enable_flag ? 1 : 0

  source  = "cn-terraform/ecs-fargate/aws"
  version = "2.0.21"
  # insert the 24 required variables here
}

That way you'll control when the module is deployed