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

mq_broker: don't recreate when auto_minor_version_upgrade and host_instance_type changed #20661

Merged
merged 17 commits into from
Feb 8, 2022

Conversation

nitrocode
Copy link
Contributor

@nitrocode nitrocode commented Aug 23, 2021

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment 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 pull request followers and do not help prioritize the request

Why

The mq broker should not be recreated when

  • auto minor version upgrade is enabled/disabled
  • the host instance type is modified.

References

Commands

$ aws mq update-broker --broker-id <b-guid> --no-auto-minor-version-upgrade
{
    "AutoMinorVersionUpgrade": false,
    "BrokerId": "<b-guid>"
}
$ aws mq update-broker --broker-id <b-guid> --auto-minor-version-upgrade
{
    "AutoMinorVersionUpgrade": true,
    "BrokerId": "<b-guid>"
}
$ aws mq update-broker --broker-id <b-guid> --host-instance-type mq.t3.micro
{
    "BrokerId": "<b-guid>",
    "HostInstanceType": "mq.t3.micro"
}

Testing

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAWSMqBroker_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSMqBroker_ -timeout 180m
=== RUN   TestAccAWSMqBroker_basic
=== PAUSE TestAccAWSMqBroker_basic
=== RUN   TestAccAWSMqBroker_throughputOptimized
=== PAUSE TestAccAWSMqBroker_throughputOptimized
=== RUN   TestAccAWSMqBroker_allFieldsDefaultVpc
=== PAUSE TestAccAWSMqBroker_allFieldsDefaultVpc
=== RUN   TestAccAWSMqBroker_allFieldsCustomVpc
=== PAUSE TestAccAWSMqBroker_allFieldsCustomVpc
=== RUN   TestAccAWSMqBroker_EncryptionOptions_KmsKeyId
=== PAUSE TestAccAWSMqBroker_EncryptionOptions_KmsKeyId
=== RUN   TestAccAWSMqBroker_EncryptionOptions_UseAwsOwnedKey_Disabled
=== PAUSE TestAccAWSMqBroker_EncryptionOptions_UseAwsOwnedKey_Disabled
=== RUN   TestAccAWSMqBroker_EncryptionOptions_UseAwsOwnedKey_Enabled
=== PAUSE TestAccAWSMqBroker_EncryptionOptions_UseAwsOwnedKey_Enabled
=== RUN   TestAccAWSMqBroker_updateUsers
=== PAUSE TestAccAWSMqBroker_updateUsers
=== RUN   TestAccAWSMqBroker_tags
=== PAUSE TestAccAWSMqBroker_tags
=== RUN   TestAccAWSMqBroker_updateSecurityGroup
=== PAUSE TestAccAWSMqBroker_updateSecurityGroup
=== RUN   TestAccAWSMqBroker_updateEngineVersion
=== PAUSE TestAccAWSMqBroker_updateEngineVersion
=== RUN   TestAccAWSMqBroker_disappears
=== PAUSE TestAccAWSMqBroker_disappears
=== RUN   TestAccAWSMqBroker_rabbitmq
=== PAUSE TestAccAWSMqBroker_rabbitmq
=== RUN   TestAccAWSMqBroker_rabbitmq_Logs
=== PAUSE TestAccAWSMqBroker_rabbitmq_Logs
=== RUN   TestAccAWSMqBroker_rabbitmq_Validation_AuditLog
=== PAUSE TestAccAWSMqBroker_rabbitmq_Validation_AuditLog
=== RUN   TestAccAWSMqBroker_clusterRabbitMQ
=== PAUSE TestAccAWSMqBroker_clusterRabbitMQ
=== RUN   TestAccAWSMqBroker_ldap
=== PAUSE TestAccAWSMqBroker_ldap
=== CONT  TestAccAWSMqBroker_basic
=== CONT  TestAccAWSMqBroker_updateSecurityGroup
=== CONT  TestAccAWSMqBroker_EncryptionOptions_UseAwsOwnedKey_Disabled
=== CONT  TestAccAWSMqBroker_rabbitmq_Validation_AuditLog
=== CONT  TestAccAWSMqBroker_updateUsers
=== CONT  TestAccAWSMqBroker_rabbitmq_Logs
=== CONT  TestAccAWSMqBroker_rabbitmq
=== CONT  TestAccAWSMqBroker_disappears
=== CONT  TestAccAWSMqBroker_ldap
=== CONT  TestAccAWSMqBroker_tags
=== CONT  TestAccAWSMqBroker_allFieldsCustomVpc
=== CONT  TestAccAWSMqBroker_updateEngineVersion
=== CONT  TestAccAWSMqBroker_clusterRabbitMQ
=== CONT  TestAccAWSMqBroker_EncryptionOptions_KmsKeyId
=== CONT  TestAccAWSMqBroker_EncryptionOptions_UseAwsOwnedKey_Enabled
=== CONT  TestAccAWSMqBroker_allFieldsDefaultVpc
=== CONT  TestAccAWSMqBroker_throughputOptimized
--- PASS: TestAccAWSMqBroker_rabbitmq_Validation_AuditLog (811.07s)
--- PASS: TestAccAWSMqBroker_rabbitmq_Logs (841.96s)
--- PASS: TestAccAWSMqBroker_rabbitmq (875.04s)
--- PASS: TestAccAWSMqBroker_throughputOptimized (952.62s)
--- PASS: TestAccAWSMqBroker_clusterRabbitMQ (1158.37s)
--- PASS: TestAccAWSMqBroker_basic (1230.64s)
--- PASS: TestAccAWSMqBroker_EncryptionOptions_UseAwsOwnedKey_Disabled (1315.97s)
--- PASS: TestAccAWSMqBroker_EncryptionOptions_KmsKeyId (1334.22s)
--- PASS: TestAccAWSMqBroker_disappears (1342.43s)
--- PASS: TestAccAWSMqBroker_ldap (1351.62s)
--- PASS: TestAccAWSMqBroker_EncryptionOptions_UseAwsOwnedKey_Enabled (1417.87s)
--- PASS: TestAccAWSMqBroker_tags (1491.41s)
--- PASS: TestAccAWSMqBroker_updateEngineVersion (1651.67s)
--- PASS: TestAccAWSMqBroker_updateSecurityGroup (1668.08s)
--- PASS: TestAccAWSMqBroker_updateUsers (1878.46s)
--- PASS: TestAccAWSMqBroker_allFieldsDefaultVpc (2078.91s)
--- PASS: TestAccAWSMqBroker_allFieldsCustomVpc (2139.86s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	2141.654s

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. size/XS Managed by automation to categorize the size of a PR. service/mq Issues and PRs that pertain to the mq service. and removed needs-triage Waiting for first response or review from a maintainer. labels Aug 23, 2021
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome @nitrocode 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTING guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

@nitrocode nitrocode marked this pull request as ready for review August 23, 2021 15:33
@nitrocode nitrocode changed the title mq_broker: rm auto_minor_version_upgrade ForceNew mq_broker: rm auto_minor_version_upgrade and host_instance_type's ForceNew Aug 23, 2021
@nitrocode
Copy link
Contributor Author

cc: @breathingdust Friendly ping for this small PR. Could I please get a review or what I can do to get this approved?

@zhelding
Copy link
Contributor

Pull request #21306 has significantly refactored the AWS Provider codebase. As a result, most PRs opened prior to the refactor now have merge conflicts that must be resolved before proceeding.

Specifically, PR #21306 relocated the code for all AWS resources and data sources from a single aws directory to a large number of separate directories in internal/service, each corresponding to a particular AWS service. This separation of code has also allowed for us to simplify the names of underlying functions -- while still avoiding namespace collisions.

We recognize that many pull requests have been open for some time without yet being addressed by our maintainers. Therefore, we want to make it clear that resolving these conflicts in no way affects the prioritization of a particular pull request. Once a pull request has been prioritized for review, the necessary changes will be made by a maintainer -- either directly or in collaboration with the pull request author.

For a more complete description of this refactor, including examples of how old filepaths and function names correspond to their new counterparts: please refer to issue #20000.

For a quick guide on how to amend your pull request to resolve the merge conflicts resulting from this refactor and bring it in line with our new code patterns: please refer to our Service Package Refactor Pull Request Guide.

@github-actions github-actions bot added pre-service-packages Includes pre-Service Packages aspects. and removed service/mq Issues and PRs that pertain to the mq service. labels Oct 20, 2021
@nitrocode
Copy link
Contributor Author

@zhelding conflicts resolved 😄

@github-actions github-actions bot added service/mq Issues and PRs that pertain to the mq service. and removed pre-service-packages Includes pre-Service Packages aspects. labels Oct 20, 2021
@nitrocode
Copy link
Contributor Author

@zhelding @breathingdust hi all, just a friendly bump. is there anything else i can do to get this in the next release?

@zhelding
Copy link
Contributor

Hi @nitrocode!

No further action is required on your part. We will now review your PR as part of our standard triage prioritization process (see here). Unfortunately, we can't guarantee that your PR will get a review in a timely manner, but we will get to it as soon as we have capacity.

Thanks again for your contribution!

@nitrocode nitrocode changed the title mq_broker: rm auto_minor_version_upgrade and host_instance_type's ForceNew mq_broker: make auto_minor_version_upgrade and host_instance_type optional Nov 26, 2021
@YakDriver YakDriver self-assigned this Feb 7, 2022
@github-actions github-actions bot added tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. size/L Managed by automation to categorize the size of a PR. and removed size/XS Managed by automation to categorize the size of a PR. labels Feb 7, 2022
@github-actions github-actions bot added size/XL Managed by automation to categorize the size of a PR. and removed size/L Managed by automation to categorize the size of a PR. labels Feb 7, 2022
@YakDriver YakDriver changed the title mq_broker: make auto_minor_version_upgrade and host_instance_type optional mq_broker: don't recreate when auto_minor_version_upgrade and host_instance_type changed Feb 7, 2022
Copy link
Member

@YakDriver YakDriver left a comment

Choose a reason for hiding this comment

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

Looks good! 🎉

Output from tests on us-west-2:

% make testacc TESTS=TestAccMQBroker PKG=mq                        
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/mq/... -v -count 1 -parallel 20 -run='TestAccMQBroker'  -timeout 180m
--- PASS: TestAccMQBroker_RabbitMQ_logs (738.37s)
--- PASS: TestAccMQBroker_throughputOptimized (845.89s)
--- PASS: TestAccMQBroker_RabbitMQ_validationAuditLog (897.57s)
--- PASS: TestAccMQBroker_RabbitMQ_basic (928.72s)
--- PASS: TestAccMQBroker_RabbitMQ_cluster (969.69s)
--- PASS: TestAccMQBrokerDataSource_basic (1149.69s)
--- PASS: TestAccMQBroker_disappears (1188.89s)
--- PASS: TestAccMQBroker_ldap (1190.90s)
--- PASS: TestAccMQBroker_basic (1192.11s)
--- PASS: TestAccMQBroker_Update_tags (1210.83s)
--- PASS: TestAccMQBroker_EncryptionOptions_kmsKeyID (1215.07s)
--- PASS: TestAccMQBroker_EncryptionOptions_awsOwnedKeyDisabled (1221.20s)
--- PASS: TestAccMQBroker_EncryptionOptions_awsOwnedKeyEnabled (1243.07s)
--- PASS: TestAccMQBroker_Update_securityGroup (1419.21s)
--- PASS: TestAccMQBroker_Update_engineVersion (1421.85s)
--- PASS: TestAccMQBroker_Update_users (1693.32s)
--- PASS: TestAccMQBroker_AllFields_customVPC (1818.89s)
--- PASS: TestAccMQBroker_AllFields_defaultVPC (1910.09s)
--- PASS: TestAccMQBroker_Update_hostInstanceType (1984.85s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/mq	1986.138s

Test output (GovCloud):

% make testacc TESTS=TestAccMQBroker PKG=mq
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/mq/... -v -count 1 -parallel 20 -run='TestAccMQBroker'  -timeout 180m
--- PASS: TestAccMQBroker_RabbitMQ_validationAuditLog (717.94s)
--- PASS: TestAccMQBroker_RabbitMQ_logs (718.85s)
--- PASS: TestAccMQBroker_RabbitMQ_basic (765.38s)
--- PASS: TestAccMQBroker_throughputOptimized (852.94s)
--- FAIL: TestAccMQBroker_RabbitMQ_cluster (953.56s)
--- PASS: TestAccMQBroker_EncryptionOptions_awsOwnedKeyDisabled (1002.93s)
--- PASS: TestAccMQBroker_ldap (1007.61s)
--- PASS: TestAccMQBroker_basic (1018.00s)
--- PASS: TestAccMQBroker_EncryptionOptions_awsOwnedKeyEnabled (1021.03s)
--- PASS: TestAccMQBroker_Update_tags (1065.76s)
--- PASS: TestAccMQBroker_disappears (1090.48s)
--- PASS: TestAccMQBroker_EncryptionOptions_kmsKeyID (1096.04s)
--- PASS: TestAccMQBrokerDataSource_basic (1114.37s)
--- PASS: TestAccMQBroker_Update_engineVersion (1189.83s)
--- PASS: TestAccMQBroker_Update_securityGroup (1286.25s)
--- PASS: TestAccMQBroker_Update_users (1510.20s)
--- PASS: TestAccMQBroker_Update_hostInstanceType (1570.17s)
--- PASS: TestAccMQBroker_AllFields_customVPC (1689.72s)
--- PASS: TestAccMQBroker_AllFields_defaultVPC (1696.97s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/mq	1698.262s

Failure shows up in nightlies for GovCloud and is unrelated to these changes.

@YakDriver YakDriver merged commit 68a5938 into hashicorp:main Feb 8, 2022
@github-actions github-actions bot added this to the v4.0.0 milestone Feb 8, 2022
@github-actions
Copy link

This functionality has been released in v4.0.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!

@nitrocode nitrocode deleted the patch-1 branch February 18, 2022 14:58
@github-actions
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 May 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/mq Issues and PRs that pertain to the mq service. size/XL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should be able to update Amazon MQ instance type without recreating broker
3 participants