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

aws_rds_cluster_parameter_group shows an unintended diff about time_zone #14072

Closed
chroju opened this issue Jul 7, 2020 · 5 comments
Closed
Labels
bug Addresses a defect in current functionality. service/rds Issues and PRs that pertain to the rds service. stale Old or inactive issues managed by automation, if no further action taken these will get closed.

Comments

@chroju
Copy link
Contributor

chroju commented Jul 7, 2020

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

Terraform v0.12.28
+ provider.aws v2.69.0

Affected Resource(s)

  • aws_rds_cluster_parameter_group

Terraform Configuration Files

resource "aws_rds_cluster_parameter_group" "sample" {
  name   = "sample"
  family = "aurora-mysql5.7"

  parameter {
    name         = "time_zone"
    value        = "Asia/Tokyo"
    apply_method = "immediate"
  }

}

Debug Output

Nothing.

Panic Output

Nothing.

Expected Behavior

Once we run terraform apply and then run terraform plan, the result should be no changes.

Actual Behavior

The difference is displayed as follows.

      + parameter {
          + apply_method = "immediate"
          + name         = "time_zone"
          + value        = "Asia/Tokyo"
        }
      - parameter {
          - apply_method = "immediate" -> null
          - name         = "time_zone" -> null
          - value        = "asia/tokyo" -> null
        }

Since it's not possible to set time_zone to lowercase, I suspect this is a bug. I think this is due to the ToLower() in the flattenParameters() function.

https://github.com/terraform-providers/terraform-provider-aws/blob/2b183022f881e6ccb0d2a1cb0a750f52daf89d5d/aws/structure.go#L931-L950

Steps to Reproduce

  1. terraform apply
  2. terraform plan

Important Factoids

Nothing.

References

@ghost ghost added the service/rds Issues and PRs that pertain to the rds service. label Jul 7, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Jul 7, 2020
@chroju chroju changed the title aws_db_parameter_group shows an unintended diff about time_zone aws_rds_cluster_parameter_group shows an unintended diff about time_zone Jul 7, 2020
@breathingdust breathingdust added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Jul 7, 2020
@acdha
Copy link
Contributor

acdha commented Oct 27, 2020

#15583 appears to be the same underlying issue

@bill-rich
Copy link
Contributor

Hi @chroju! I was trying to reproduce this issue, but was not able to with provided configuration. If you're still seeing this issue, can you post a config that I can use to test a fix?

@bill-rich bill-rich self-assigned this Mar 4, 2021
@chroju
Copy link
Contributor Author

chroju commented Mar 9, 2021

Hi @bill-rich . I tried to reproduce this problem again.

The config to reproduce the problem is as follows.

resource "aws_rds_cluster_parameter_group" "test1" {
  name   = "test1"
  family = "aurora-mysql5.7"


  parameter {
    name         = "time_zone"
    value        = "UTC"
    apply_method = "immediate"
  }

  parameter {
    name         = "server_audit_logging"
    value        = "0"                       # this is same as the default value
    apply_method = "immediate"
  }
}

resource "aws_rds_cluster_parameter_group" "test2" {
  name   = "test2"
  family = "aurora-mysql5.7"


  parameter {
    name         = "time_zone"
    value        = "UTC"
    apply_method = "immediate"
  }
}

Once you have run apply, run plan. The result is as follows.

  # aws_rds_cluster_parameter_group.test will be updated in-place
  ~ resource "aws_rds_cluster_parameter_group" "test1" {
        id          = "test1"
        name        = "test1"
        tags        = {}
        # (3 unchanged attributes hidden)

      + parameter {
          + apply_method = "immediate"
          + name         = "server_audit_logging"
          + value        = "0"
        }
      + parameter {
          + apply_method = "immediate"
          + name         = "time_zone"
          + value        = "UTC"
        }
      - parameter {
          - apply_method = "immediate" -> null
          - name         = "time_zone" -> null
          - value        = "utc" -> null
        }
    }

Plan: 0 to add, 1 to change, 0 to destroy.

This behavior is probably caused by the difference in server_audit_logging, Because the test2 resource with only time_zone parameter does not show the diff.

Therefore, my initial thought that the diff might be caused by the letter case seems to be wrong. When there is some other diff, the difference in letter case will also be shown as an unintended diff.

This can be reproduced with any parameter other than server_audit_logging . For example, I have confirmed that it can be reproduced by setting aurora_binlog_read_buffer_size to 5242880 (same as the default value).

So, in my case, there are two problems.

Copy link

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!

@github-actions github-actions bot added the stale Old or inactive issues managed by automation, if no further action taken these will get closed. label May 19, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 24, 2024
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 Jul 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/rds Issues and PRs that pertain to the rds service. stale Old or inactive issues managed by automation, if no further action taken these will get closed.
Projects
None yet
Development

No branches or pull requests

4 participants