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

memorydb: add new multi_region_cluster resource #40376

Merged
merged 72 commits into from
Dec 18, 2024

Conversation

bschaatsbergen
Copy link
Member

@bschaatsbergen bschaatsbergen commented Dec 1, 2024

Closes #40374

make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/memorydb/... -v -count 1 -parallel 20 -run='TestAccMemoryDBCluster_multiRegionClusterName'  -timeout 360m
2024/12/16 10:29:32 Initializing Terraform AWS Provider...
=== RUN   TestAccMemoryDBCluster_multiRegionClusterName
=== PAUSE TestAccMemoryDBCluster_multiRegionClusterName
=== CONT  TestAccMemoryDBCluster_multiRegionClusterName
--- PASS: TestAccMemoryDBCluster_multiRegionClusterName (1136.99s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/memorydb   1144.572s
---
 $ make testacc TESTS=TestAccMemoryDBMultiRegionCluster_ PKG=memorydb
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/memorydb/... -v -count 1 -parallel 20 -run='TestAccMemoryDBMultiRegionCluster_'  -timeout 360m
2024/12/16 09:34:53 Initializing Terraform AWS Provider...
=== RUN   TestAccMemoryDBMultiRegionCluster_basic
=== PAUSE TestAccMemoryDBMultiRegionCluster_basic
=== RUN   TestAccMemoryDBMultiRegionCluster_defaults
=== PAUSE TestAccMemoryDBMultiRegionCluster_defaults
=== RUN   TestAccMemoryDBMultiRegionCluster_description
=== PAUSE TestAccMemoryDBMultiRegionCluster_description
=== RUN   TestAccMemoryDBMultiRegionCluster_tlsEnabled
=== PAUSE TestAccMemoryDBMultiRegionCluster_tlsEnabled
=== RUN   TestAccMemoryDBMultiRegionCluster_engine
=== PAUSE TestAccMemoryDBMultiRegionCluster_engine
=== RUN   TestAccMemoryDBMultiRegionCluster_engineVersion
=== PAUSE TestAccMemoryDBMultiRegionCluster_engineVersion
=== RUN   TestAccMemoryDBMultiRegionCluster_updateStrategy
=== PAUSE TestAccMemoryDBMultiRegionCluster_updateStrategy
=== RUN   TestAccMemoryDBMultiRegionCluster_numShards
=== PAUSE TestAccMemoryDBMultiRegionCluster_numShards
=== RUN   TestAccMemoryDBMultiRegionCluster_nodeType
=== PAUSE TestAccMemoryDBMultiRegionCluster_nodeType
=== RUN   TestAccMemoryDBMultiRegionCluster_parameterGroup
=== PAUSE TestAccMemoryDBMultiRegionCluster_parameterGroup
=== RUN   TestAccMemoryDBMultiRegionCluster_tags
=== PAUSE TestAccMemoryDBMultiRegionCluster_tags
=== CONT  TestAccMemoryDBMultiRegionCluster_basic
=== CONT  TestAccMemoryDBMultiRegionCluster_updateStrategy
=== CONT  TestAccMemoryDBMultiRegionCluster_tlsEnabled
=== CONT  TestAccMemoryDBMultiRegionCluster_numShards
=== CONT  TestAccMemoryDBMultiRegionCluster_engineVersion
=== CONT  TestAccMemoryDBMultiRegionCluster_description
=== CONT  TestAccMemoryDBMultiRegionCluster_parameterGroup
=== CONT  TestAccMemoryDBMultiRegionCluster_tags
=== CONT  TestAccMemoryDBMultiRegionCluster_engine
=== CONT  TestAccMemoryDBMultiRegionCluster_defaults
=== CONT  TestAccMemoryDBMultiRegionCluster_nodeType
--- PASS: TestAccMemoryDBMultiRegionCluster_engineVersion (72.69s)
--- PASS: TestAccMemoryDBMultiRegionCluster_basic (75.16s)
--- PASS: TestAccMemoryDBMultiRegionCluster_defaults (75.22s)
--- PASS: TestAccMemoryDBMultiRegionCluster_engine (75.23s)
--- PASS: TestAccMemoryDBMultiRegionCluster_parameterGroup (75.23s)
--- PASS: TestAccMemoryDBMultiRegionCluster_description (75.28s)
--- PASS: TestAccMemoryDBMultiRegionCluster_tlsEnabled (75.29s)
--- PASS: TestAccMemoryDBMultiRegionCluster_tags (100.11s)
--- PASS: TestAccMemoryDBMultiRegionCluster_numShards (106.74s)
--- PASS: TestAccMemoryDBMultiRegionCluster_nodeType (129.69s)
--- PASS: TestAccMemoryDBMultiRegionCluster_updateStrategy (140.16s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/memorydb   147.867s

Copy link

github-actions bot commented Dec 1, 2024

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 service/memorydb Issues and PRs that pertain to the memorydb service. needs-triage Waiting for first response or review from a maintainer. external-maintainer Contribution from a trusted external contributor. labels Dec 1, 2024
@github-actions github-actions bot added the generators Relates to code generators. label Dec 2, 2024
@bryantbiggs
Copy link
Contributor

FYI - its merged now #40380

@github-actions github-actions bot added the tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. label Dec 3, 2024
jar-b added 10 commits December 16, 2024 14:58
```console
% make testacc PKG=memorydb TESTS="TestAccMemoryDBCluster_multiRegionClusterName"
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/memorydb/... -v -count 1 -parallel 20 -run='TestAccMemoryDBCluster_multiRegionClusterName'  -timeout 360m
2024/12/16 14:24:29 Initializing Terraform AWS Provider...

--- PASS: TestAccMemoryDBCluster_multiRegionClusterName (1932.43s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/memorydb   1937.485s
```
The `Update` API only allows one of node type, shard configuration, or parameter group name to be updated in a single request. The provider will now serialize update requests in the case where more than one of these arguments are modified during a single apply.

```console
% make testacc PKG=memorydb TESTS="TestAccMemoryDBMultiRegionCluster_"
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/memorydb/... -v -count 1 -parallel 20 -run='Tes
2024/12/16 16:52:20 Initializing Terraform AWS Provider...

--- PASS: TestAccMemoryDBMultiRegionCluster_engineVersion (88.78s)
--- PASS: TestAccMemoryDBMultiRegionCluster_defaults (89.07s)
--- PASS: TestAccMemoryDBMultiRegionCluster_description (89.07s)
--- PASS: TestAccMemoryDBMultiRegionCluster_parameterGroup (89.07s)
--- PASS: TestAccMemoryDBMultiRegionCluster_tlsEnabled (89.07s)
--- PASS: TestAccMemoryDBMultiRegionCluster_engine (89.09s)
--- PASS: TestAccMemoryDBMultiRegionCluster_basic (89.11s)
--- PASS: TestAccMemoryDBMultiRegionCluster_tags (108.07s)
--- PASS: TestAccMemoryDBMultiRegionCluster_numShards (152.33s)
--- PASS: TestAccMemoryDBMultiRegionCluster_nodeType (161.55s)
--- PASS: TestAccMemoryDBMultiRegionCluster_updateStrategy (188.85s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/memorydb   194.018s
```
Also simplifies acceptance test configurations and merges the `defaults`
test case with `basic`.

```console
% make testacc PKG=memorydb TESTS="TestAccMemoryDBMultiRegionCluster_"
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/memorydb/... -v -count 1 -parallel 20 -run='TestAccMemoryDBMultiRegionCluster_'  -timeout 360m
2024/12/17 13:10:16 Initializing Terraform AWS Provider...

--- PASS: TestAccMemoryDBMultiRegionCluster_disappears (56.94s)
--- PASS: TestAccMemoryDBMultiRegionCluster_basic (66.06s)
--- PASS: TestAccMemoryDBMultiRegionCluster_engine (66.08s)
--- PASS: TestAccMemoryDBMultiRegionCluster_engineVersion (66.10s)
--- PASS: TestAccMemoryDBMultiRegionCluster_tlsEnabled (66.10s)
--- PASS: TestAccMemoryDBMultiRegionCluster_description (66.10s)
--- PASS: TestAccMemoryDBMultiRegionCluster_parameterGroup (66.10s)
--- PASS: TestAccMemoryDBMultiRegionCluster_tags (82.06s)
--- PASS: TestAccMemoryDBMultiRegionCluster_numShards (115.65s)
--- PASS: TestAccMemoryDBMultiRegionCluster_nodeType (116.70s)
--- PASS: TestAccMemoryDBMultiRegionCluster_updateStrategy (164.88s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/memorydb   170.051s
```
…_enabled`

The argument is now changed to optional and computed to allow for the default value to be configured by AWS when omitted, rather than set explicitly to a hardcoded value in the provider.

```console
% make testacc PKG=memorydb TESTS="TestAccMemoryDBMultiRegionCluster_"
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/memorydb/... -v -count 1 -parallel 20 -run='TestAccMemoryDBMultiRegionCluster_'  -timeout 360m
2024/12/17 13:24:43 Initializing Terraform AWS Provider...

--- PASS: TestAccMemoryDBMultiRegionCluster_disappears (57.02s)
--- PASS: TestAccMemoryDBMultiRegionCluster_parameterGroup (65.62s)
--- PASS: TestAccMemoryDBMultiRegionCluster_description (66.54s)
--- PASS: TestAccMemoryDBMultiRegionCluster_engineVersion (66.80s)
--- PASS: TestAccMemoryDBMultiRegionCluster_basic (66.90s)
--- PASS: TestAccMemoryDBMultiRegionCluster_engine (66.97s)
--- PASS: TestAccMemoryDBMultiRegionCluster_tags (88.16s)
--- PASS: TestAccMemoryDBMultiRegionCluster_numShards (116.65s)
--- PASS: TestAccMemoryDBMultiRegionCluster_tlsEnabled (117.55s)
--- PASS: TestAccMemoryDBMultiRegionCluster_nodeType (122.02s)
--- PASS: TestAccMemoryDBMultiRegionCluster_updateStrategy (165.72s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/memorydb   171.075s
```
jar-b
jar-b previously approved these changes Dec 17, 2024
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 🎉

% make testacc PKG=memorydb TESTS="TestAccMemoryDBMultiRegionCluster_"
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/memorydb/... -v -count 1 -parallel 20 -run='TestAccMemoryDBMultiRegionCluster_'  -timeout 360m
2024/12/17 13:24:43 Initializing Terraform AWS Provider...

--- PASS: TestAccMemoryDBMultiRegionCluster_disappears (57.02s)
--- PASS: TestAccMemoryDBMultiRegionCluster_parameterGroup (65.62s)
--- PASS: TestAccMemoryDBMultiRegionCluster_description (66.54s)
--- PASS: TestAccMemoryDBMultiRegionCluster_engineVersion (66.80s)
--- PASS: TestAccMemoryDBMultiRegionCluster_basic (66.90s)
--- PASS: TestAccMemoryDBMultiRegionCluster_engine (66.97s)
--- PASS: TestAccMemoryDBMultiRegionCluster_tags (88.16s)
--- PASS: TestAccMemoryDBMultiRegionCluster_numShards (116.65s)
--- PASS: TestAccMemoryDBMultiRegionCluster_tlsEnabled (117.55s)
--- PASS: TestAccMemoryDBMultiRegionCluster_nodeType (122.02s)
--- PASS: TestAccMemoryDBMultiRegionCluster_updateStrategy (165.72s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/memorydb   171.075s

@jar-b
Copy link
Member

jar-b commented Dec 17, 2024

Thanks for your contribution, @bschaatsbergen! 🚀

The `multi_region_cluster_name` attribute will be used for import and read operations, aligning with the primary identifer used by the AWS API.

```console
% make testacc PKG=memorydb TESTS="TestAccMemoryDBMultiRegionCluster_"
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/memorydb/... -v -count 1 -parallel 20 -run='TestAccMemoryDBMultiRegionCluster_'  -timeout 360m
2024/12/18 09:13:35 Initializing Terraform AWS Provider...

--- PASS: TestAccMemoryDBMultiRegionCluster_disappears (57.86s)
--- PASS: TestAccMemoryDBMultiRegionCluster_parameterGroup (66.57s)
--- PASS: TestAccMemoryDBMultiRegionCluster_basic (67.35s)
--- PASS: TestAccMemoryDBMultiRegionCluster_engineVersion (67.36s)
--- PASS: TestAccMemoryDBMultiRegionCluster_description (67.37s)
--- PASS: TestAccMemoryDBMultiRegionCluster_engine (67.47s)
--- PASS: TestAccMemoryDBMultiRegionCluster_tags (83.31s)
--- PASS: TestAccMemoryDBMultiRegionCluster_numShards (116.48s)
--- PASS: TestAccMemoryDBMultiRegionCluster_nodeType (118.62s)
--- PASS: TestAccMemoryDBMultiRegionCluster_tlsEnabled (118.65s)
--- PASS: TestAccMemoryDBMultiRegionCluster_updateStrategy (165.98s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/memorydb   175.713s
```
@jar-b
Copy link
Member

jar-b commented Dec 18, 2024

Acceptance test results after removing the id attribute.

% make testacc PKG=memorydb TESTS="TestAccMemoryDBMultiRegionCluster_"
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/memorydb/... -v -count 1 -parallel 20 -run='TestAccMemoryDBMultiRegionCluster_'  -timeout 360m
2024/12/18 09:13:35 Initializing Terraform AWS Provider...

--- PASS: TestAccMemoryDBMultiRegionCluster_disappears (57.86s)
--- PASS: TestAccMemoryDBMultiRegionCluster_parameterGroup (66.57s)
--- PASS: TestAccMemoryDBMultiRegionCluster_basic (67.35s)
--- PASS: TestAccMemoryDBMultiRegionCluster_engineVersion (67.36s)
--- PASS: TestAccMemoryDBMultiRegionCluster_description (67.37s)
--- PASS: TestAccMemoryDBMultiRegionCluster_engine (67.47s)
--- PASS: TestAccMemoryDBMultiRegionCluster_tags (83.31s)
--- PASS: TestAccMemoryDBMultiRegionCluster_numShards (116.48s)
--- PASS: TestAccMemoryDBMultiRegionCluster_nodeType (118.62s)
--- PASS: TestAccMemoryDBMultiRegionCluster_tlsEnabled (118.65s)
--- PASS: TestAccMemoryDBMultiRegionCluster_updateStrategy (165.98s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/memorydb   175.713s

@johnsonaj
Copy link
Contributor

@jar-b one last suggestion to guard against partial failures. Otherwise, LGTM 🚀

% make testacc PKG=memorydb TESTS="TestAccMemoryDBMultiRegionCluster_"

make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/memorydb/... -v -count 1 -parallel 20 -run='TestAccMemoryDBMultiRegionCluster_'  -timeout 360m
2024/12/18 09:25:22 Initializing Terraform AWS Provider...
--- PASS: TestAccMemoryDBMultiRegionCluster_disappears (58.12s)
--- PASS: TestAccMemoryDBMultiRegionCluster_engine (64.57s)
--- PASS: TestAccMemoryDBMultiRegionCluster_description (65.04s)
--- PASS: TestAccMemoryDBMultiRegionCluster_engineVersion (66.29s)
--- PASS: TestAccMemoryDBMultiRegionCluster_basic (66.68s)
--- PASS: TestAccMemoryDBMultiRegionCluster_parameterGroup (66.70s)
--- PASS: TestAccMemoryDBMultiRegionCluster_tags (83.94s)
--- PASS: TestAccMemoryDBMultiRegionCluster_tlsEnabled (117.03s)
--- PASS: TestAccMemoryDBMultiRegionCluster_nodeType (118.05s)
--- PASS: TestAccMemoryDBMultiRegionCluster_numShards (130.49s)
--- PASS: TestAccMemoryDBMultiRegionCluster_updateStrategy (168.39s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/memorydb	179.548s

jar-b and others added 2 commits December 18, 2024 10:33
Set a partial state so that this resource taints if the waiter fails.

Co-authored-by: Adrian Johnson <[email protected]>
@jar-b jar-b enabled auto-merge December 18, 2024 15:36
@jar-b
Copy link
Member

jar-b commented Dec 18, 2024

Tests after the latest changes.

% make testacc PKG=memorydb TESTS="TestAccMemoryDBMultiRegionCluster_"
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.3 test ./internal/service/memorydb/... -v -count 1 -parallel 20 -run='TestAccMemoryDBMultiRegionCluster_'  -timeout 360m
2024/12/18 10:34:20 Initializing Terraform AWS Provider...

--- PASS: TestAccMemoryDBMultiRegionCluster_disappears (58.14s)
--- PASS: TestAccMemoryDBMultiRegionCluster_description (66.38s)
--- PASS: TestAccMemoryDBMultiRegionCluster_parameterGroup (67.13s)
--- PASS: TestAccMemoryDBMultiRegionCluster_engineVersion (67.15s)
--- PASS: TestAccMemoryDBMultiRegionCluster_engine (67.24s)
--- PASS: TestAccMemoryDBMultiRegionCluster_basic (67.24s)
--- PASS: TestAccMemoryDBMultiRegionCluster_tags (82.74s)
--- PASS: TestAccMemoryDBMultiRegionCluster_numShards (117.22s)
--- PASS: TestAccMemoryDBMultiRegionCluster_tlsEnabled (118.25s)
--- PASS: TestAccMemoryDBMultiRegionCluster_nodeType (118.27s)
--- PASS: TestAccMemoryDBMultiRegionCluster_updateStrategy (166.07s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/memorydb   172.545s

@jar-b jar-b merged commit 75ebf25 into hashicorp:main Dec 18, 2024
40 checks passed
@github-actions github-actions bot added this to the v5.82.0 milestone Dec 18, 2024
@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Dec 19, 2024
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. external-maintainer Contribution from a trusted external contributor. generators Relates to code generators. service/memorydb Issues and PRs that pertain to the memorydb service. 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.

Amazon MemoryDB Multi-Region
5 participants