Skip to content

Option Group gets created even if key is set to false #272

@chanster

Description

@chanster

When setting creation of replica to false, the DB option group for replica still gets created.

tfvars

db_create = true
db_replica_create = false

tf

module "db" {
    source = "terraform-aws-modules/rds/aws"
    version= "~> 2.20"

    create_db_instance        = var.db_create
    create_db_option_group    = var.db_create
    create_db_parameter_group = var.db_create
    create_db_subnet_group    = var.db_create
    ...
}

module "db_replica" {
    source = "terraform-aws-modules/rds/aws"
    version= "~> 2.20"

    create_db_instance        = var.db_replica_create
    # replicas do not have these configurations
    create_db_option_group    = false
    create_db_parameter_group = false
    create_db_subnet_group    = false

    replicate_source_db = module.db.this_db_instance_id
    ...
}

TF output

module.db_replica.module.db_option_group.aws_db_option_group.this[0]: Creating...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions