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_mq_configuration revision increment not showing in plan #14842

Closed
askainet opened this issue Aug 25, 2020 · 4 comments · Fixed by #14850
Closed

aws_mq_configuration revision increment not showing in plan #14842

askainet opened this issue Aug 25, 2020 · 4 comments · Fixed by #14850
Assignees
Labels
bug Addresses a defect in current functionality. service/mq Issues and PRs that pertain to the mq service.
Milestone

Comments

@askainet
Copy link

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 CLI and Terraform AWS Provider Version

Terraform v0.12.29
+ provider.aws v3.3.0

Affected Resource(s)

  • aws_mq_configuration

Terraform Configuration Files

resource "aws_mq_configuration" "this" {
  name           = "testing"
  description    = "MQ broker configuration for testing"
  engine_type    = "ActiveMQ"
  engine_version = "5.15.12"
  data           = file("${path.module}/amazonmq_config.xml")
  tags = {
    Tag = timestamp()
  }
}

Expected Behavior

Terraform does not create a new aws_mq_configuration revision when only updating tags, OR
if AWS is who actually creates a new aws_mq_configuration revision when updating tags, then the provider must reflect that and show the revision increment.

Actual Behavior

A new aws_mq_configuration revision is created, despite the plan not showing it:

  1. terraform apply
  # aws_mq_configuration.this will be updated in-place
  ~ resource "aws_mq_configuration" "this" {
        ...redacted...
        latest_revision = 1
      ~ tags            = {
          - "Tag" = "2020-08-25T20:07:59Z"
        } -> (known after apply)
    }
  1. terraform apply again, and we find revision was indeed incremented despite not being shown in previous plan
  # aws_mq_configuration.this will be updated in-place
  ~ resource "aws_mq_configuration" "this" {
        ...redacted...
        latest_revision = 2
      ~ tags            = {
          - "Tag" = "2020-08-25T20:08:30Z"
        } -> (known after apply)
    }

This generates drift when referring this aws_mq_configuration in a aws_mq_broker resource, and even makes a terraform apply -auto-approve fail with error:

Error: Provider produced inconsistent final plan

When expanding the plan for aws_mq_broker.this to include new values learned
so far during apply, provider "registry.terraform.io/-/aws" produced an
invalid new value for .configuration.revision: was cty.NumberIntVal(1), but
now cty.NumberIntVal(2).

Steps to Reproduce

  1. terraform apply

Important Factoids

Same behaviour occurs using provider version 2.70.0

@ghost ghost added the service/mq Issues and PRs that pertain to the mq service. label Aug 25, 2020
@askainet askainet changed the title aws_mq_configuration aws_mq_configuration revision increment not showing in plan Aug 25, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Aug 25, 2020
@ewbankkit ewbankkit added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Aug 26, 2020
@ewbankkit
Copy link
Contributor

ewbankkit commented Aug 26, 2020

@askainet Thanks for raising this issue.
You are correct that updating just the tags on the resource causes the configuration to be updated also:

https://github.com/terraform-providers/terraform-provider-aws/blob/eae0bc7053091ab78f24c8a98da5011977d4c353/aws/resource_aws_mq_configuration.go#L152-L181

I have opened #14850 to address this.

@bflad
Copy link
Contributor

bflad commented Aug 28, 2020

The fix for this has been merged and will release with version 3.5.0 of the Terraform AWS Provider, later next week. Thanks to @ewbankkit for the implementation. 👍

@ghost
Copy link

ghost commented Sep 3, 2020

This has been released in version 3.5.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Sep 28, 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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Sep 28, 2020
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/mq Issues and PRs that pertain to the mq service.
Projects
None yet
3 participants