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

sql_mode in an RDS parameter group always causes an update #886

Closed
bitglue opened this issue Jan 28, 2015 · 2 comments · Fixed by #1225
Closed

sql_mode in an RDS parameter group always causes an update #886

bitglue opened this issue Jan 28, 2015 · 2 comments · Fixed by #1225

Comments

@bitglue
Copy link

bitglue commented Jan 28, 2015

Given this:

resource "aws_db_parameter_group" "test" {
    name = "test"
    family = "mysql5.6"
    description = "just a test"

    parameter {
        name = "sql_mode"
        value = "STRICT_ALL_TABLES"
    }
}

You can apply that, and a parameter group will be made with sql_mode=STRICT_ALL_TABLES. The state file will reflect that fact:

                "aws_db_parameter_group.test": {
                    "type": "aws_db_parameter_group",
                    "primary": {
                        "id": "test",
                        "attributes": {
                            "description": "just a test",
                            "family": "mysql5.6",
                            "id": "test",
                            "name": "test",
                            "parameter.#": "1",
                            "parameter.1506707202.name": "sql_mode",
                            "parameter.1506707202.value": "strict_all_tables"
                        }
                    }
                },

But now do a plan:

~ aws_db_parameter_group.test
    parameter.2228267888.name:  "" => "sql_mode"
    parameter.2228267888.value: "" => "STRICT_ALL_TABLES"

If I'm reading this correctly, this means Terraform read the resource, and thinks that the parameter is empty and it needs to create it. I'm not expecting any update because the parameter group already exists with sql_mode=STRICT_ALL_TABLES in RDS.

Confusingly, my attempts to instrument the conversation with RDS indicates that Terraform is getting sql_mode=STRICT_ALL_TABLES from RDS, at least as far as flattenParameters. And oddly, I can reproduce this only with sql_mode -- every other parameter I've tried works fine. Not sure what's special about that one, and I'm out of ideas.

@catsby
Copy link
Contributor

catsby commented Mar 17, 2015

Fixed in #1225

@catsby catsby closed this as completed Mar 17, 2015
@ghost
Copy link

ghost commented May 4, 2020

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.

@ghost ghost locked and limited conversation to collaborators May 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants