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 fails to update to a version with required automatic minor version upgrades #40806

Open
JankoMat opened this issue Jan 7, 2025 · 3 comments
Labels
bug Addresses a defect in current functionality. service/mq Issues and PRs that pertain to the mq service.

Comments

@JankoMat
Copy link

JankoMat commented Jan 7, 2025

Terraform Core Version

v1.5.7

AWS Provider Version

v5.82.2

Affected Resource(s)

aws_mq_broker

Expected Behavior

Updating from a minor version with automatic minor version upgrades disabled (example: activemq 5.17.6) to a major version that requires automatic minor version upgrades (example: activemq 5.18) should work as long as auto_minor_version_upgrade is set to true.

Actual Behavior

Upgrade from 5.17.6 to 5.18 fails with the following error:

# aws_mq_broker.example will be updated in-place
  ~ resource "aws_mq_broker" "example" {
      ~ auto_minor_version_upgrade = false -> true
      ~ engine_version             = "5.17.6" -> "5.18"
        id                         = "xxx"
        tags                       = {}
        # (13 unchanged attributes hidden)

        # (5 unchanged blocks hidden)
    }

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

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

aws_mq_broker.example: Modifying... [id=xxx]
╷
│ Error: updating MQ Broker (xxx) configuration: operation error mq: UpdateBroker, https response error StatusCode: 400, RequestID: xxx, BadRequestException: Brokers upgrading to [ActiveMQ] version [5.18] must have [autoMinorVersionUpgrade] set to [true].
│ 
│   with aws_mq_broker.example,
│   on main.tf line 5, in resource "aws_mq_broker" "example":
│    5: resource "aws_mq_broker" "example" {
│ 

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

provider "aws" {
  region = "us-east-1"
}

resource "aws_mq_broker" "example" {
  broker_name = "example"

  engine_type                = "ActiveMQ"
  engine_version             = "5.17.6"
  host_instance_type         = "mq.t2.micro"
  security_groups            = ["xxx"]

  user {
    username = "xxx"
    password = "xxx"
  }
}

Steps to Reproduce

Create an Active MQ broker using the 5.17.6 Engine Version with the provided file (the example from the official documentation). Edit the file to change the Engine Version to 5.18 and add the auto_minor_version_upgrade = true option.
Run terraform apply and it will fail.

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

@JankoMat JankoMat added the bug Addresses a defect in current functionality. label Jan 7, 2025
Copy link

github-actions bot commented Jan 7, 2025

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 service/mq Issues and PRs that pertain to the mq service. needs-triage Waiting for first response or review from a maintainer. labels Jan 7, 2025
@justinretzolk
Copy link
Member

Hey @JankoMat 👋 Thank you for taking the time to raise this! My initial suspicion is that this is due to maintenance windows. Since you're not specifying the apply_immediately argument, it defaults to false, and broker modifications happen during the next maintenance window. I suspect that due to this, your change to auto_minor_version_upgrade isn't yet applied, and so the modification is rejected.

I don't have anything other than my gut to back this up at the moment, but I'm also not sure the API would allow for modifying the auto_minor_version_upgrade setting and the version at the same time. That could be tested with the AWS CLI or by hitting the API directly, if the above doesn't help sort things out.

@justinretzolk justinretzolk added the waiting-response Maintainers are waiting on response from community or contributor. label Jan 14, 2025
@JankoMat
Copy link
Author

Hey, @justinretzolk Thank you for the response, I tested it again with the apply_immediately = true and got the same error. The first time I saw this issue in the wild I had apply_immediately set to true.
I confirmed that I could update both of these using the AWS Console at once, and that is what I did for my existing instances.

I tried updating the same instance that Terraform was failing to update using aws cli and that seems to have worked:

$ aws mq update-broker --broker-id b-xxx --engine-version 5.18 --auto-minor-version-upgrade
{
    "AutoMinorVersionUpgrade": true,
    "BrokerId": "b-xxx",
    "EngineVersion": "5.18"
}
$ aws mq reboot-broker --broker-id b-xxx

@github-actions github-actions bot removed the waiting-response Maintainers are waiting on response from community or contributor. label Jan 14, 2025
@justinretzolk justinretzolk removed the needs-triage Waiting for first response or review from a maintainer. label Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. service/mq Issues and PRs that pertain to the mq service.
Projects
None yet
Development

No branches or pull requests

2 participants