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

[Bug]: aws_mq_broker only allows me to set engine version to 3.13 instead of 3.13.6 #38930

Closed
borela opened this issue Aug 19, 2024 · 11 comments · Fixed by #39024
Closed

[Bug]: aws_mq_broker only allows me to set engine version to 3.13 instead of 3.13.6 #38930

borela opened this issue Aug 19, 2024 · 11 comments · Fixed by #39024
Labels
bug Addresses a defect in current functionality. service/mq Issues and PRs that pertain to the mq service.
Milestone

Comments

@borela
Copy link

borela commented Aug 19, 2024

Terraform Core Version

1.8.2-1

AWS Provider Version

5.63.0

Affected Resource(s)

aws_mq_broker

Expected Behavior

Allowed me to set engine version using the minor version too.

Actual Behavior

Keeps trying to set it to 3.13

# module.aws.module.rabbitmq_v3_13.aws_mq_broker.broker will be updated in-place
~ resource "aws_mq_broker" "broker" {
    ~ engine_version                = "3.13.6" -> "3.13"
      id                            = "b-e380aa62-9e30-4f2e-bac5-bffb1415307c"
      tags                          = {
          "App" = "Shared"
      }
      # (16 unchanged attributes hidden)

    ~ configuration {
        ~ id       = "c-5902d33e-0ef9-45d1-b5c2-abb62fa27812" -> "c-917a03fc-aaed-4f9c-9f5c-2e92e669376e"
          # (1 unchanged attribute hidden)
      }

      # (3 unchanged blocks hidden)
  }

But later, on the next apply, it notices AWS set it to 3.13.6

Note: Objects have changed outside of Terraform

Terraform detected the following changes made outside of Terraform since the last "terraform apply" which may have affected this plan:

  # module.aws.module.rabbitmq_v3_13.aws_mq_broker.broker has changed
  ~ resource "aws_mq_broker" "broker" {
      ~ engine_version                = "3.13" -> "3.13.6"
        id                            = "b-e380aa62-9e30-4f2e-bac5-bffb1415307c"
        tags                          = {
            "App" = "Shared"
        }
        # (16 unchanged attributes hidden)

      ~ configuration {
          ~ id       = "c-917a03fc-aaed-4f9c-9f5c-2e92e669376e" -> "c-5902d33e-0ef9-45d1-b5c2-abb62fa27812"
            # (1 unchanged attribute hidden)
        }

        # (3 unchanged blocks hidden)
    }

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

If I try to set to 3.13.6, it gives an error.

│ Error: creating MQ Configuration (staging-main-v3_13-configuration): operation error mq: CreateConfiguration, https response error StatusCode: 400, RequestID: 14095f86-a3c7-4185-9413-7bc6f95c873e, BadRequestException: Broker engine version [3.13.6] is invalid for broker engine type [RABBITMQ]. Valid values: [3.13, 3.12.13, 3.11.28, 3.11.20, 3.11.16, 3.10.25, 3.10.20, 3.10.10, 3.9.27].

Steps to Reproduce

Try to create any rabbitmq instance with the version 3.13.6

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

@borela borela added the bug Addresses a defect in current functionality. label Aug 19, 2024
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • 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.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added the service/mq Issues and PRs that pertain to the mq service. label Aug 19, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Aug 19, 2024
@ofiesh
Copy link

ofiesh commented Aug 20, 2024

The desired behavior for setting the minor version does not solve the problem.

With 3.13, automatic minor version upgrades are required (which is why we can't set the minor version). If terraform allows us to specify the minor version and that matches the latest, when a new minor version is released it will reintroduce the problem.

The expected behavior should be:
When the automatic minor version upgrades are enabled and the major version matches, then terraform should not change the version.

@borela
Copy link
Author

borela commented Aug 20, 2024

@ofiesh That makes sense; your proposed solution would solve the problem much better.

@m-brgs
Copy link

m-brgs commented Aug 20, 2024

Exactly the same problem with ActiveMQ where AWS enforces "auto minor updates" since version 5.18 (i.e. patch upgrades in version number) but the server still returns the patch version number. This means that any auto-patch from AWS will create a diff in Terraform -- which is a no-go for us.

We expect to specify 5.18 without the patch value in the engine_version variable as auto minor version upgrades are enforced since this ActiveMQ version.

"BadRequestException: Brokers on [ActiveMQ] version [5.18] must have [autoMinorVersionUpgrade] set to [true]."

# The servers responds 5.18.4 after the upgrade.
# If we apply this, it triggers an update (i.e. reboot) of the cluster (which is not expected) but no version is changed (which is expected).
  ~ resource "aws_mq_broker" "activemq" {
      ~ engine_version             = "5.18.4" -> "5.18"

Note that the aws_mq_configuration does expects and returns 5.18 and will give an error if we try to specify the patch number when using version >= 5.18. This behavior seems appropriate.

resource "aws_mq_configuration" "broker" {
  engine_version = var.engine_version

We decided to tell Terraform to ignore changes until this issue is fixed.

  lifecycle {
    ignore_changes = [ engine_version ]
  }

@justinretzolk
Copy link
Member

Similar #38708

@justinretzolk justinretzolk removed the needs-triage Waiting for first response or review from a maintainer. label Aug 20, 2024
@architec
Copy link
Contributor

architec commented Aug 20, 2024

Hi, I can work on this issue

@justinretzolk

@architec
Copy link
Contributor

The solution proposed by @ofiesh will additionally resolve issue #14705.

@el-chazmo
Copy link

I reached out to AWS regarding this. Response was: -

With the introduction of compulsory automatic minor version upgrades for 5.18, where the service will always default to the next compatible and secure patch version upon broker creation/update, it would be expected for MQ to only allow you to select version 5.18 given the dynamic nature of this approach.

Copy link

Warning

This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.

@github-actions github-actions bot added this to the v5.68.0 milestone Sep 13, 2024
Copy link

This functionality has been released in v5.68.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. Thank you!

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 Oct 22, 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/mq Issues and PRs that pertain to the mq service.
Projects
None yet
6 participants