Skip to content

[Enhancement] aws_docdbelastic_cluster: Add shard_instance_count argument#46938

Open
tabito-hara wants to merge 4 commits intohashicorp:mainfrom
tabito-hara:f-aws_docdbelastic_cluster-add_shard_instance_count
Open

[Enhancement] aws_docdbelastic_cluster: Add shard_instance_count argument#46938
tabito-hara wants to merge 4 commits intohashicorp:mainfrom
tabito-hara:f-aws_docdbelastic_cluster-add_shard_instance_count

Conversation

@tabito-hara
Copy link
Contributor

Rollback Plan

If a change needs to be reverted, we will publish an updated version of the library.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

Description

This PR adds shard_instance_count argument for aws_docdbelastic_cluster resource.

  • Even if aws_docdbelastic_cluster is not specified, the AWS API returns its default value 2. Therefore, shard_instance_count is marked as Computed.

Relations

Closes #46924

References

https://docs.aws.amazon.com/documentdb/latest/developerguide/API_elastic_CreateCluster.html#documentdb-elastic_CreateCluster-request-shardInstanceCount

https://docs.aws.amazon.com/documentdb/latest/developerguide/elastic-get-started.html#elastic-get-started-clusters

c. In the Shard instance count field, choose the number of replica instances you want associated with each shard. The maximum number of shard instances is 16, in increments of 1. All replica instances have the same shard capacity as defined in the following field. For testing purposes, the default value of 2 should suffice.

Output from Acceptance Testing

$ make testacc TESTS='TestAccDocDBElasticCluster_' PKG=docdbelastic 
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
make: Running acceptance tests on branch: 🌿 f-aws_docdbelastic_cluster-add_shard_instance_count 🌿...
TF_ACC=1 go1.25.8 test ./internal/service/docdbelastic/... -v -count 1 -parallel 20 -run='TestAccDocDBElasticCluster_'  -timeout 360m -vet=off
2026/03/14 23:56:48 Creating Terraform AWS Provider (SDKv2-style)...
2026/03/14 23:56:48 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN   TestAccDocDBElasticCluster_Identity_basic
=== PAUSE TestAccDocDBElasticCluster_Identity_basic
=== RUN   TestAccDocDBElasticCluster_Identity_regionOverride
=== PAUSE TestAccDocDBElasticCluster_Identity_regionOverride
=== RUN   TestAccDocDBElasticCluster_Identity_ExistingResource_basic
=== PAUSE TestAccDocDBElasticCluster_Identity_ExistingResource_basic
=== RUN   TestAccDocDBElasticCluster_Identity_ExistingResource_noRefreshNoChange
=== PAUSE TestAccDocDBElasticCluster_Identity_ExistingResource_noRefreshNoChange
=== RUN   TestAccDocDBElasticCluster_basic
=== PAUSE TestAccDocDBElasticCluster_basic
=== RUN   TestAccDocDBElasticCluster_disappears
=== PAUSE TestAccDocDBElasticCluster_disappears
=== RUN   TestAccDocDBElasticCluster_tags
=== PAUSE TestAccDocDBElasticCluster_tags
=== RUN   TestAccDocDBElasticCluster_update
=== PAUSE TestAccDocDBElasticCluster_update
=== RUN   TestAccDocDBElasticCluster_shardInstanceCount
=== PAUSE TestAccDocDBElasticCluster_shardInstanceCount
=== CONT  TestAccDocDBElasticCluster_Identity_basic
=== CONT  TestAccDocDBElasticCluster_disappears
=== CONT  TestAccDocDBElasticCluster_update
=== CONT  TestAccDocDBElasticCluster_tags
=== CONT  TestAccDocDBElasticCluster_Identity_ExistingResource_basic
=== CONT  TestAccDocDBElasticCluster_Identity_regionOverride
=== CONT  TestAccDocDBElasticCluster_shardInstanceCount
=== CONT  TestAccDocDBElasticCluster_Identity_ExistingResource_noRefreshNoChange
=== CONT  TestAccDocDBElasticCluster_basic
--- PASS: TestAccDocDBElasticCluster_disappears (1806.35s)
--- PASS: TestAccDocDBElasticCluster_Identity_basic (1924.01s)
--- PASS: TestAccDocDBElasticCluster_tags (1985.47s)
--- PASS: TestAccDocDBElasticCluster_Identity_ExistingResource_basic (2057.37s)
--- PASS: TestAccDocDBElasticCluster_shardInstanceCount (2067.40s)
--- PASS: TestAccDocDBElasticCluster_Identity_ExistingResource_noRefreshNoChange (2121.86s)
--- PASS: TestAccDocDBElasticCluster_Identity_regionOverride (2137.44s)
--- PASS: TestAccDocDBElasticCluster_basic (2139.44s)
--- PASS: TestAccDocDBElasticCluster_update (2376.41s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/docdbelastic       2380.808s

@github-actions
Copy link
Contributor

Community Guidelines

This comment is added to every new Pull Request to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀

Voting for Prioritization

  • Please vote on this Pull Request by adding a 👍 reaction to the original post to help the community and maintainers prioritize it.
  • Please see our prioritization guide for additional information on how the maintainers handle prioritization.
  • Please do not leave +1 or other comments that do not add relevant new information or questions; they generate extra noise for others following the Pull Request and do not help prioritize the request.

Pull Request Authors

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • 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 needs-triage Waiting for first response or review from a maintainer. documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/docdbelastic Issues and PRs that pertain to the docdbelastic service. size/M Managed by automation to categorize the size of a PR. labels Mar 14, 2026
@tabito-hara tabito-hara marked this pull request as ready for review March 14, 2026 23:49
@tabito-hara tabito-hara requested a review from a team as a code owner March 14, 2026 23:49
@dosubot dosubot bot added the enhancement Requests to existing resources that expand the functionality or scope. label Mar 14, 2026
@justinretzolk justinretzolk removed the needs-triage Waiting for first response or review from a maintainer. label Mar 17, 2026
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. service/docdbelastic Issues and PRs that pertain to the docdbelastic 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.

Amazon DocumentDB Terraform resource - add the ability to modify the replica count

2 participants