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

Support replication specification for aws keyspaces #36331

Conversation

shrutha1988
Copy link

@shrutha1988 shrutha1988 commented Mar 12, 2024

Description

AWS Keyspaces started supporting Multi region replication since mid of last year. The current Pull Request adds supports for optionally specifying the replication specification while creating AWS keyspaces. The replication specification includes ReplicationStrategy(Can hold values of SINGLE_REGION and MULTI_REGION), the region list if the MULTI_REGION replication strategy is specified. Please review and let me know if the changes are sufficient. Let me know in case more changes are needed to handle this scenario. In tests, we have covered both the replication scenarios and the tests are creating the required keyspaces with valid replications. All the tests have passed now.

Expected resource would look like this:

resource "aws_keyspaces_keyspace" "test" {
  name = keyspace_name
  ReplicationSpecification {
	ReplicationStrategy = MULTI_REGION
	RegionList = ["us-east-1", "us-west-1"]
  }
}

Relations

Closes #32150.

References

https://aws.amazon.com/blogs/database/announcing-amazon-keyspaces-multi-region-replication/

Output from Acceptance Testing

% make testacc TESTS=TestAccKeyspaces PKG=keyspaces
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/keyspaces/... -v -count 1 -parallel 20 -run='TestAccKeyspaces'  -timeout 360m
=== RUN   TestAccKeyspacesKeyspace_basic
=== PAUSE TestAccKeyspacesKeyspace_basic
=== RUN   TestAccKeyspacesKeyspace_replicationSpecification
=== PAUSE TestAccKeyspacesKeyspace_replicationSpecification
=== RUN   TestAccKeyspacesKeyspace_disappears
=== PAUSE TestAccKeyspacesKeyspace_disappears
=== RUN   TestAccKeyspacesKeyspace_tags
=== PAUSE TestAccKeyspacesKeyspace_tags
=== RUN   TestAccKeyspacesTable_basic
=== PAUSE TestAccKeyspacesTable_basic
=== RUN   TestAccKeyspacesTable_disappears
=== PAUSE TestAccKeyspacesTable_disappears
=== RUN   TestAccKeyspacesTable_tags
=== PAUSE TestAccKeyspacesTable_tags
=== RUN   TestAccKeyspacesTable_clientSideTimestamps
=== PAUSE TestAccKeyspacesTable_clientSideTimestamps
=== RUN   TestAccKeyspacesTable_multipleColumns
=== PAUSE TestAccKeyspacesTable_multipleColumns
=== RUN   TestAccKeyspacesTable_update
=== PAUSE TestAccKeyspacesTable_update
=== RUN   TestAccKeyspacesTable_addColumns
=== PAUSE TestAccKeyspacesTable_addColumns
=== RUN   TestAccKeyspacesTable_delColumns
=== PAUSE TestAccKeyspacesTable_delColumns
=== CONT  TestAccKeyspacesKeyspace_basic
=== CONT  TestAccKeyspacesTable_update
=== CONT  TestAccKeyspacesTable_clientSideTimestamps
=== CONT  TestAccKeyspacesKeyspace_disappears
=== CONT  TestAccKeyspacesKeyspace_replicationSpecification
=== CONT  TestAccKeyspacesTable_addColumns
=== CONT  TestAccKeyspacesTable_tags
=== CONT  TestAccKeyspacesTable_multipleColumns
=== CONT  TestAccKeyspacesTable_delColumns
=== CONT  TestAccKeyspacesKeyspace_tags
=== CONT  TestAccKeyspacesTable_disappears
=== CONT  TestAccKeyspacesTable_basic
--- PASS: TestAccKeyspacesKeyspace_basic (88.42s)
--- PASS: TestAccKeyspacesKeyspace_disappears (91.89s)
--- PASS: TestAccKeyspacesKeyspace_replicationSpecification (105.57s)
--- PASS: TestAccKeyspacesTable_disappears (134.14s)
--- PASS: TestAccKeyspacesKeyspace_tags (140.05s)
--- PASS: TestAccKeyspacesTable_multipleColumns (145.79s)
--- PASS: TestAccKeyspacesTable_basic (146.67s)
--- PASS: TestAccKeyspacesTable_clientSideTimestamps (153.67s)
--- PASS: TestAccKeyspacesTable_addColumns (170.55s)
--- PASS: TestAccKeyspacesTable_tags (174.94s)
--- PASS: TestAccKeyspacesTable_delColumns (198.87s)
--- PASS: TestAccKeyspacesTable_update (1039.79s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/keyspaces  1044.374s

...

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/keyspaces Issues and PRs that pertain to the keyspaces service. size/M Managed by automation to categorize the size of a PR. labels Mar 12, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Mar 12, 2024
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 @shrutha1988 👋

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 CONTRIBUTOR 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! 😃

@shrutha1988 shrutha1988 marked this pull request as ready for review March 13, 2024 14:17
@justinretzolk justinretzolk added enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Mar 13, 2024
# Conflicts:
#	internal/service/keyspaces/keyspace_test.go
@ewbankkit ewbankkit self-assigned this Oct 29, 2024
@github-actions github-actions bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Oct 29, 2024
@ewbankkit ewbankkit requested a review from a team as a code owner October 29, 2024 20:10
Copy link
Contributor

@ewbankkit ewbankkit 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 TESTARGS='-run=TestAccKeyspacesKeyspace_' PKG=keyspaces ACCTEST_PARALLELISM=3
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.2 test ./internal/service/keyspaces/... -v -count 1 -parallel 3  -run=TestAccKeyspacesKeyspace_ -timeout 360m
2024/10/29 16:11:05 Initializing Terraform AWS Provider...
=== RUN   TestAccKeyspacesKeyspace_basic
=== PAUSE TestAccKeyspacesKeyspace_basic
=== RUN   TestAccKeyspacesKeyspace_replicationSpecificationMulti
=== PAUSE TestAccKeyspacesKeyspace_replicationSpecificationMulti
=== RUN   TestAccKeyspacesKeyspace_disappears
=== PAUSE TestAccKeyspacesKeyspace_disappears
=== RUN   TestAccKeyspacesKeyspace_tags
=== PAUSE TestAccKeyspacesKeyspace_tags
=== CONT  TestAccKeyspacesKeyspace_basic
=== CONT  TestAccKeyspacesKeyspace_disappears
=== CONT  TestAccKeyspacesKeyspace_replicationSpecificationMulti
--- PASS: TestAccKeyspacesKeyspace_disappears (57.98s)
=== CONT  TestAccKeyspacesKeyspace_tags
--- PASS: TestAccKeyspacesKeyspace_basic (59.89s)
--- PASS: TestAccKeyspacesKeyspace_replicationSpecificationMulti (117.32s)
--- PASS: TestAccKeyspacesKeyspace_tags (75.54s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/keyspaces	138.499s

@shrutha1988
Copy link
Author

Completing the pull request.

@shrutha1988 shrutha1988 reopened this Oct 29, 2024
@ewbankkit
Copy link
Contributor

@shrutha1988 Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit b2a257d into hashicorp:main Oct 29, 2024
76 of 77 checks passed
@github-actions github-actions bot added this to the v5.74.0 milestone Oct 29, 2024
@gdavison gdavison mentioned this pull request Oct 30, 2024
@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Oct 31, 2024
Copy link

This functionality has been released in v5.74.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
enhancement Requests to existing resources that expand the functionality or scope. service/keyspaces Issues and PRs that pertain to the keyspaces service. size/M 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.

[Enhancement]: Add MULTI_REGION replicationStrategy for amazon keyspaces
3 participants