terraform-aws-rds-aurora
terraform-aws-rds-aurora copied to clipboard
Allow me to conditionally set the number of instances depending on environment
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
- Don't use workspaces for environment isolation
- Use locals and you can probably achieve your desired outcome
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?
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
This issue was automatically closed because of stale in 10 days
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.