terraform-aws-rds-aurora icon indicating copy to clipboard operation
terraform-aws-rds-aurora copied to clipboard

Allow me to conditionally set the number of instances depending on environment

Open james-green-affinity opened this issue 3 years ago β€’ 2 comments

Is your request related to a new offering from AWS?

Is this functionality available in the AWS provider for Terraform? See CHANGELOG.md, too.

Is your request related to a problem? Please describe.

Currently I have Aurora V2 defined like this for all environments: instance_class = "db.serverless" instances = { one = { availability_zone = "eu-west-2a", writer = true } two = { availability_zone = "eu-west-2b" } }

Just on my test environment I would like this instead: instance_class = "db.serverless" instances = { one = { availability_zone = "eu-west-2a", writer = true } }

Describe the solution you'd like.

A solution that will allow me to conditionally define the number of instances per environment.

Describe alternatives you've considered.

I have tried to make use of: var.is_dev == "true" ? json : json count = 0

However I could not get either of these terraform conditionals to work.

Additional context

I would like to save money on my Test environment

james-green-affinity avatar Jul 12 '22 12:07 james-green-affinity

  1. Don't use workspaces for environment isolation
  2. Use locals and you can probably achieve your desired outcome

bryantbiggs avatar Jul 20 '22 11:07 bryantbiggs

I recently ran into this issue as well. On a previous version of this module, I used to set a conditional on replica_count:

replica_count = var.enable_high_availability ? var.number_of_replicas : 0

Which is now deprecated in the latest version of the module it appears.

Suggestion: add an example of a similar configuration to the instances = {} config map?

CaseyLabs avatar Aug 11 '22 12:08 CaseyLabs

This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 10 days

github-actions[bot] avatar Sep 11 '22 00:09 github-actions[bot]

This issue was automatically closed because of stale in 10 days

github-actions[bot] avatar Sep 21 '22 00:09 github-actions[bot]

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

github-actions[bot] avatar Apr 13 '23 02:04 github-actions[bot]