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

I am unable to pass the parameters of parameter group from a variable to module. Is there a specific format that I need to use to pass the "name & value" of db_parameter_group #28

Closed
ghost opened this issue Nov 26, 2017 · 4 comments

Comments

@ghost
Copy link

ghost commented Nov 26, 2017

@antonbabenko @khosrow

parameter = ["${var.parameters}"]

@khosrow
Copy link
Contributor

khosrow commented Nov 26, 2017

@phanindra2407 How are you passing your parameters?

I have a working setup with the following variables passed to the module:

module "db" {
    source = "terraform-aws-modules/rds/aws"
    engine            = "postgres"
    engine_version    = "9.6.3"
    family = "postgres9.6"
    # some stuff removed here for brevity

    parameters = [
        { 
            name = "client_encoding",
            value = "utf8"
        }
    ]
}

@ghost
Copy link
Author

ghost commented Nov 26, 2017

@khosrow, Thank you for the response.Below is the way I am trying to code.
module "db" {
source = "terraform-aws-modules/rds/aws"
engine = "postgres"
engine_version = "9.6.3"
family = "postgres9.6"

parameters = ["${var.db_parameters}"]
}

##Passing varibales ##
variable "db_parameters" {
type = "list"
default = [
{
name = "log_connections"
value = 1
},
{
name = "pg.audit"
value = "pg_audit"
}
]
}

I will need to modify these parameters frequently. so cannot hardcode them in the module.

@antonbabenko
Copy link
Member

I think the code which @khosrow is writing is correct but the error can be is that you pass incorrect parameters (check AWS RDS documentation for details). This is what I got when I run your code:

* aws_db_parameter_group.this: Error modifying DB Parameter Group: InvalidParameterValue: Could not find parameter with name: pg.audit
	status code: 400, request id: c8a64a1a-aaa6-42a8-99ff-fd04747658ee

If you could update examples/complete/postgres with the failing code which should be actually working then we can have another look. Closing for now.

@github-actions
Copy link

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 github-actions bot locked as resolved and limited conversation to collaborators Nov 17, 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

No branches or pull requests

2 participants