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

fix: RabbitMQ 3.13 and ActiveMQ 5.18 Version Mismatch #39024

Merged

Conversation

architec
Copy link
Contributor

@architec architec commented Aug 23, 2024

Description

Terraform encounters version mismatch with Amazon MQ RabbitMQ 3.13 and ActiveMQ 5.18, causing unnecessary reboots due to patch-level updates.

Relations

Closes #38930
Closes #38708

References

Starting from RabbitMQ 3.13, Amazon MQ will manage patch version upgrades for your brokers. All brokers on version 3.13 will be automatically upgraded to the latest compatible and secure patch version in your scheduled maintenance window.

https://aws.amazon.com/about-aws/whats-new/2024/07/amazon-mq-rabbitmq-version-3-13/

Output from Acceptance Testing

% PKG=mq make testacc TESTS=TestAccMQBroker_basic

% PKG=mq make testacc TESTS=TestAccMQBroker_RabbitMQ_basic

% PKG=mq make test
...

…3 and ActiveMQ 5.18 change to their corresponding patch version
…3 and ActiveMQ 5.18 change to their corresponding patch version
…3 and ActiveMQ 5.18 change to their corresponding patch version
@architec architec requested a review from a team as a code owner August 23, 2024 21:47
Copy link

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull 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.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/mq Issues and PRs that pertain to the mq service. needs-triage Waiting for first response or review from a maintainer. labels Aug 23, 2024
return *engineVersion
}
majorMinorEngineVersion := semver.MajorMinor("v" + *engineVersion)
rabbitSimplifiedVersion := "v3.13"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for picking this up @architec as I was looking at this issue as well. With this setup don't we have to update the code when AWS releases a new version? Also I was looking at how the RDS service had it working and setting up an actual_engine_version attribute?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, this PR will necessitate code updates when Amazon MQ releases new versions. However, I can submit a subsequent pull request to modify the change, making it applicable to all versions >= 3.13 for RabbitMQ and versions >= 5.18 for ActiveMQ.

With the subsequent PR, adding an attribute such as actual_engine_version is unnecessary.

@justinretzolk justinretzolk added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Aug 26, 2024
@architec architec requested a review from mprince August 26, 2024 23:08
@jar-b jar-b self-assigned this Sep 11, 2024
@github-actions github-actions bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Sep 11, 2024
```console
% make testacc PKG=mq TESTS=TestAccMQBroker_normalizedEngineVersion
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.6 test ./internal/service/mq/... -v -count 1 -parallel 20 -run='TestAccMQBroker_normalizedEngineVersion'  -timeout 360m

--- PASS: TestAccMQBroker_normalizedEngineVersion (973.99s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/mq 980.237s
```

```console
% go test -count=1 ./internal/service/mq/... -run=TestNormalizeEngineVersion
ok      github.com/hashicorp/terraform-provider-aws/internal/service/mq 6.269s
```
@jar-b
Copy link
Member

jar-b commented Sep 11, 2024

Thanks for your submission @architec! 👍

I'm working through some failures on the RabbitMQ acceptance tests which appear unrelated to this change (tags drift). Once those are resolved I'll proceed with merging this in.

Copy link

Thank you for your contribution! 🚀

Please note that typically Go dependency changes are handled in this repository by dependabot or the maintainers. This is to prevent pull request merge conflicts and further delay reviews of contributions. Remove any changes to the go.mod or go.sum files and commit them into this pull request.

Additional details:

  • Check open pull requests with the dependencies label to view other dependency updates.
  • If this pull request includes an update the AWS Go SDK (or any other dependency) version, only updates submitted via dependabot will be merged. This pull request will need to remove these changes and will need to be rebased after the existing dependency update via dependabot has been merged for this pull request to be reviewed.
  • If this pull request is for supporting a new AWS service:
    • Ensure the new AWS service changes are following the Contributing Guide section on new services, in particular that the dependency addition and initial provider support are in a separate pull request from other changes (e.g. new resources). Contributions not following this item will not be reviewed until the changes are split.
    • If this pull request is already a separate pull request from the above item, you can ignore this message.

@jar-b
Copy link
Member

jar-b commented Sep 12, 2024

I've isolated the acceptance testing failures to a change in Terraform core 1.8.0. Running with 1.7.5 yields passing tests, so I'm going to run the full suite broker suite with that version now and file a separate issue to continue this research.

Will merge this once the full test suite completes.

% TF_ACC_TERRAFORM_VERSION=1.7.5 make testacc PKG=mq TESTS="TestAccMQBroker_normalizedEngineVersion|TestAccMQBroker_RabbitMQ_autoMinorVersionUpgrade|TestAccMQBroker_RabbitMQ_normalizedEngineVersion"
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.6 test ./internal/service/mq/... -v -count 1 -parallel 20 -run='TestAccMQBroker_normalizedEngineVersion|TestAccMQBroker_RabbitMQ_autoMinorVersionUpgrade|TestAccMQBroker_RabbitMQ_normalizedEngineVersion'  -timeout 360m
=== RUN   TestAccMQBroker_normalizedEngineVersion
=== PAUSE TestAccMQBroker_normalizedEngineVersion
=== RUN   TestAccMQBroker_RabbitMQ_autoMinorVersionUpgrade
=== PAUSE TestAccMQBroker_RabbitMQ_autoMinorVersionUpgrade
=== RUN   TestAccMQBroker_RabbitMQ_normalizedEngineVersion
=== PAUSE TestAccMQBroker_RabbitMQ_normalizedEngineVersion
=== CONT  TestAccMQBroker_normalizedEngineVersion
=== CONT  TestAccMQBroker_RabbitMQ_normalizedEngineVersion
=== CONT  TestAccMQBroker_RabbitMQ_autoMinorVersionUpgrade
2024/09/12 11:43:45 [DEBUG] GET https://releases.hashicorp.com/terraform/1.7.5/index.json
2024/09/12 11:43:45 [DEBUG] GET https://releases.hashicorp.com/terraform/1.7.5/index.json
2024/09/12 11:43:45 [DEBUG] GET https://releases.hashicorp.com/terraform/1.7.5/index.json
2024/09/12 11:43:45 [DEBUG] GET https://releases.hashicorp.com/terraform/1.7.5/terraform_1.7.5_SHA256SUMS.72D7468F.sig
2024/09/12 11:43:45 [DEBUG] GET https://releases.hashicorp.com/terraform/1.7.5/terraform_1.7.5_SHA256SUMS.72D7468F.sig
2024/09/12 11:43:45 [DEBUG] GET https://releases.hashicorp.com/terraform/1.7.5/terraform_1.7.5_SHA256SUMS.72D7468F.sig
2024/09/12 11:43:45 [DEBUG] GET https://releases.hashicorp.com/terraform/1.7.5/terraform_1.7.5_SHA256SUMS
2024/09/12 11:43:45 [DEBUG] GET https://releases.hashicorp.com/terraform/1.7.5/terraform_1.7.5_SHA256SUMS
2024/09/12 11:43:45 [DEBUG] GET https://releases.hashicorp.com/terraform/1.7.5/terraform_1.7.5_SHA256SUMS
2024/09/12 11:43:45 [DEBUG] GET https://releases.hashicorp.com/terraform/1.7.5/terraform_1.7.5_darwin_arm64.zip
2024/09/12 11:43:45 [DEBUG] GET https://releases.hashicorp.com/terraform/1.7.5/terraform_1.7.5_darwin_arm64.zip
2024/09/12 11:43:45 [DEBUG] GET https://releases.hashicorp.com/terraform/1.7.5/terraform_1.7.5_darwin_arm64.zip
--- PASS: TestAccMQBroker_RabbitMQ_normalizedEngineVersion (681.96s)
--- PASS: TestAccMQBroker_RabbitMQ_autoMinorVersionUpgrade (686.64s)
--- PASS: TestAccMQBroker_normalizedEngineVersion (1182.01s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/mq 1188.204s

Previously the `engine_version` sent to the update API was the version read from the remote resource, rather than the configured value. This change passes the configured values for `engine_type`, `engine_version`, and `auto_minor_version_upgrade` to the `normalizeEngineVersion` function instead, allowing explicitly configured engine version updates to once again function properly.

```console
% TF_ACC_TERRAFORM_VERSION=1.7.5 make testacc PKG=mq TESTS="TestAccMQBroker_"
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.6 test ./internal/service/mq/... -v -count 1 -parallel 20 -run='TestAccMQBroker_'  -timeout 360m

--- PASS: TestAccMQBroker_RabbitMQ_validationAuditLog (631.07s)
=== CONT  TestAccMQBroker_normalizedEngineVersion
--- PASS: TestAccMQBroker_RabbitMQ_normalizedEngineVersion (647.54s)
=== CONT  TestAccMQBroker_RabbitMQ_basic
--- PASS: TestAccMQBroker_RabbitMQ_autoMinorVersionUpgrade (659.43s)
=== CONT  TestAccMQBroker_Update_hostInstanceType
--- PASS: TestAccMQBroker_RabbitMQ_config (662.56s)
--- PASS: TestAccMQBroker_RabbitMQ_cluster (669.10s)
--- PASS: TestAccMQBroker_RabbitMQ_logs (672.09s)
--- PASS: TestAccMQBroker_throughputOptimized (939.31s)
--- PASS: TestAccMQBroker_ldap (953.94s)
--- PASS: TestAccMQBroker_EncryptionOptions_kmsKeyID (989.45s)
--- PASS: TestAccMQBroker_EncryptionOptions_managedKeyEnabled (1038.29s)
--- PASS: TestAccMQBroker_EncryptionOptions_managedKeyDisabled (1043.15s)
--- PASS: TestAccMQBroker_disappears (1060.67s)
--- PASS: TestAccMQBroker_basic (1064.66s)
--- PASS: TestAccMQBroker_tags (1078.43s)
--- PASS: TestAccMQBroker_Update_engineVersion (1240.34s)
--- PASS: TestAccMQBroker_Update_securityGroup (1262.55s)
--- PASS: TestAccMQBroker_RabbitMQ_basic (660.77s)
--- PASS: TestAccMQBroker_Update_users (1429.44s)
--- PASS: TestAccMQBroker_normalizedEngineVersion (843.55s)
--- PASS: TestAccMQBroker_AllFields_defaultVPC (1593.85s)
--- PASS: TestAccMQBroker_AllFields_customVPC (1740.74s)
--- PASS: TestAccMQBroker_Update_hostInstanceType (1353.62s)
--- PASS: TestAccMQBroker_dataReplicationMode (2095.33s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/mq 2101.590s
```
Copy link
Member

@jar-b jar-b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉

% TF_ACC_TERRAFORM_VERSION=1.7.5 make testacc PKG=mq TESTS="TestAccMQBroker_"
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.6 test ./internal/service/mq/... -v -count 1 -parallel 20 -run='TestAccMQBroker_'  -timeout 360m

--- PASS: TestAccMQBroker_RabbitMQ_validationAuditLog (631.07s)
=== CONT  TestAccMQBroker_normalizedEngineVersion
--- PASS: TestAccMQBroker_RabbitMQ_normalizedEngineVersion (647.54s)
=== CONT  TestAccMQBroker_RabbitMQ_basic
--- PASS: TestAccMQBroker_RabbitMQ_autoMinorVersionUpgrade (659.43s)
=== CONT  TestAccMQBroker_Update_hostInstanceType
--- PASS: TestAccMQBroker_RabbitMQ_config (662.56s)
--- PASS: TestAccMQBroker_RabbitMQ_cluster (669.10s)
--- PASS: TestAccMQBroker_RabbitMQ_logs (672.09s)
--- PASS: TestAccMQBroker_throughputOptimized (939.31s)
--- PASS: TestAccMQBroker_ldap (953.94s)
--- PASS: TestAccMQBroker_EncryptionOptions_kmsKeyID (989.45s)
--- PASS: TestAccMQBroker_EncryptionOptions_managedKeyEnabled (1038.29s)
--- PASS: TestAccMQBroker_EncryptionOptions_managedKeyDisabled (1043.15s)
--- PASS: TestAccMQBroker_disappears (1060.67s)
--- PASS: TestAccMQBroker_basic (1064.66s)
--- PASS: TestAccMQBroker_tags (1078.43s)
--- PASS: TestAccMQBroker_Update_engineVersion (1240.34s)
--- PASS: TestAccMQBroker_Update_securityGroup (1262.55s)
--- PASS: TestAccMQBroker_RabbitMQ_basic (660.77s)
--- PASS: TestAccMQBroker_Update_users (1429.44s)
--- PASS: TestAccMQBroker_normalizedEngineVersion (843.55s)
--- PASS: TestAccMQBroker_AllFields_defaultVPC (1593.85s)
--- PASS: TestAccMQBroker_AllFields_customVPC (1740.74s)
--- PASS: TestAccMQBroker_Update_hostInstanceType (1353.62s)
--- PASS: TestAccMQBroker_dataReplicationMode (2095.33s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/mq 2101.590s

@jar-b
Copy link
Member

jar-b commented Sep 12, 2024

Thanks for your contribution, @architec! 👍

Apologies for the long running review.

@jar-b jar-b merged commit 07e6480 into hashicorp:main Sep 13, 2024
39 checks passed
@github-actions github-actions bot added this to the v5.68.0 milestone Sep 13, 2024
@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Sep 20, 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 pull request 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 related to this change, 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. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
4 participants