Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use false instead of 0 in enable_create_db_option_group flag #137

Merged

Conversation

robinbowes
Copy link
Contributor

@robinbowes robinbowes commented Jun 25, 2019

Description

I see this error when passing "var.create_db_option_group" as false:

Error: module.db_worker_replica.local.enable_create_db_option_group: local.enable_create_db_option_group: __builtin_StringToInt: strconv.ParseInt: parsing "false": invalid syntax in:

${var.option_group_name == "" && var.engine != "postgres" ? var.create_db_option_group : 0}

This PR seems to fix it.

Edit: Further investigation suggests that the problem occurs when create_db_option_group is passed in as a string, eg:

locals {
  some_flag = "${some_condition ? true : false}"
}

module "db" {
  source  = "terraform-aws-modules/rds/aws"
  version = "1.28.0"
  create_db_option_group    = "${local.some_flag}"
  # rest of params
}

A workaround is to pass in 1/0 instead of "true"/"false":

  create_db_option_group    = "${local.some_flag ? 1 : 0}"

@antonbabenko antonbabenko merged commit ef05613 into terraform-aws-modules:terraform011 Jun 28, 2019
@antonbabenko
Copy link
Member

Thanks Robin!

v1.29.0 has been released.

dud225 added a commit to dud225/terraform-aws-rds that referenced this pull request Jul 16, 2019
This PR is a follow-up of PR 118.

This is the exact same changeset than terraform-aws-modules#137 but for the `create_db_subnet_group`
variable.
dud225 added a commit to dud225/terraform-aws-rds that referenced this pull request Jul 16, 2019
This PR is a follow-up of PR terraform-aws-modules#118.

This is the exact same changeset than terraform-aws-modules#137 but for the `create_db_subnet_group`
variable.
antonbabenko pushed a commit that referenced this pull request Jul 17, 2019
This PR is a follow-up of PR #118.

This is the exact same changeset than #137 but for the `create_db_subnet_group`
variable.
@github-actions
Copy link

I'm going to lock this pull request 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 related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants