Skip to content

Conversation

@universalvishwa
Copy link

Rollback Plan

Just reject the PR I guess.

Description

Create a new data source aws_neptune_cluster for Neptune. The implementation is a bit different from what the issue describes. Because I noticed that many terraform data sources have data sourceaws_neptune_cluster (without an s) at then end that just returns info about 1 specific cluster with lot of detail.
But to implement the data source,

data "aws_neptune_cluster" "db" {
  filter {
    name   = "tag:Name"
    values = ["some name here"]
  }
}

I need to implement aws_neptune_clusters (with an s).

Since, the expectation is to create aws_neptune_cluster as per the issue description, The data source requires providing a Neptune cluster id as (required) input.

Relations

Closes #40081.

References

Just followed the official contribution guide.

Output from Acceptance Testing

Since creating a Neptune cluster costs money, I used it to test it against an existing Neptune cluster that is already there.

Confirmed,
✅ All tests pass
✅ make build works
✅ make gen has been run and committed

Testing commands,

% ❯ go clean -cache -testcache
% ❯ make gen 
% ❯ make fmt
% ❯ make lint
% ❯ make testacc TESTS=TestAccNeptuneClusterDataSource_basic PKG=neptune GOTESTFLAGS='-tags=acctest'
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
make: Running acceptance tests on branch: 🌿 f-aws_neptune_cluster 🌿...
TF_ACC=1 go1.24.8 test ./internal/service/neptune/... -v -count 1 -parallel 20 -run='TestAccNeptuneClusterDataSource_basic'  -timeout 360m -vet=off
2025/10/25 23:03:53 Creating Terraform AWS Provider (SDKv2-style)...
2025/10/25 23:03:53 Initializing Terraform AWS Provider (SDKv2-style)...
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/neptune    3.599s [no tests to run]

% ❯ go test ./internal/service/neptune -v -run TestAccNeptuneClusterDataSource_basic -tags=acctest
2025/10/25 23:01:39 Creating Terraform AWS Provider (SDKv2-style)...
2025/10/25 23:01:39 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN   TestAccNeptuneClusterDataSource_basic
=== PAUSE TestAccNeptuneClusterDataSource_basic
=== CONT  TestAccNeptuneClusterDataSource_basic
--- PASS: TestAccNeptuneClusterDataSource_basic (7.58s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/neptune    11.150s

% ❯ go test ./internal/service/neptune -v -run TestAccNeptuneClusterDataSource_basic -tags=acctest
2025/10/25 23:00:45 Creating Terraform AWS Provider (SDKv2-style)...
2025/10/25 23:00:45 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN   TestAccNeptuneClusterDataSource_basic
=== PAUSE TestAccNeptuneClusterDataSource_basic
=== CONT  TestAccNeptuneClusterDataSource_basic
DS: data.aws_neptune_cluster.test vpc_security_group_ids.# = 3
DS: data.aws_neptune_cluster.test % = 29
DS: data.aws_neptune_cluster.test deletion_protection = false
DS: data.aws_neptune_cluster.test associated_roles.0.role_arn = arn:aws:iam::374234635241:role/mycluster
DS: data.aws_neptune_cluster.test port = 8182
DS: data.aws_neptune_cluster.test availability_zones.2 = us-west-2c
DS: data.aws_neptune_cluster.test vpc_security_group_ids.1 = sg-044447ea4f8079340
DS: data.aws_neptune_cluster.test endpoint = mycluster.cluster-ke6g4gucjpgs-west-2.neptune.amazonaws.com
DS: data.aws_neptune_cluster.test resource_id = cluster-RHNENV3X2WETIQSTLHXKFLBK5Y
DS: data.aws_neptune_cluster.test kms_key_id = arn:aws:kms:us-west-2: 374234635241:key/a85f07a9-4daf-3e80-b390-28168ef7ff4d
DS: data.aws_neptune_cluster.test multi_az = false
DS: data.aws_neptune_cluster.test arn = arn:aws:rds:us-west-2:374234635241:cluster:mycluster
DS: data.aws_neptune_cluster.test db_subnet_group = mycluster
DS: data.aws_neptune_cluster.test availability_zones.# = 3
DS: data.aws_neptune_cluster.test associated_roles.0.% = 3
DS: data.aws_neptune_cluster.test associated_roles.# = 1
DS: data.aws_neptune_cluster.test backup_retention_period = 1
DS: data.aws_neptune_cluster.test engine = neptune
DS: data.aws_neptune_cluster.test members.0.db_instance_identifier = mycluster-instance-1
DS: data.aws_neptune_cluster.test members.0.promotion_tier = 1
DS: data.aws_neptune_cluster.test vpc_security_group_ids.2 = sg-09e906f23094ba4c7
DS: data.aws_neptune_cluster.test id = mycluster
DS: data.aws_neptune_cluster.test iam_database_authentication_enabled = true
DS: data.aws_neptune_cluster.test availability_zones.0 = us-west-2a
DS: data.aws_neptune_cluster.test members.0.is_cluster_writer = true
DS: data.aws_neptune_cluster.test vpc_security_group_ids.0 = sg-a3e8ca062aa1f37aa
DS: data.aws_neptune_cluster.test region = us-west-2
DS: data.aws_neptune_cluster.test enabled_cloudwatch_logs_exports.0 = audit
DS: data.aws_neptune_cluster.test storage_encrypted = true
DS: data.aws_neptune_cluster.test availability_zones.1 = us-west-2b
DS: data.aws_neptune_cluster.test preferred_maintenance_window = mon:11:04-mon:11:34
DS: data.aws_neptune_cluster.test members.0.parameter_group_status = in-sync
DS: data.aws_neptune_cluster.test engine_version = 1.4.5.1
DS: data.aws_neptune_cluster.test reader_endpoint = mycluster.cluster-ro-ke6g4gucjpgs.us-west-2.neptune.amazonaws.com
DS: data.aws_neptune_cluster.test associated_roles.0.feature_name = 
DS: data.aws_neptune_cluster.test status = available
DS: data.aws_neptune_cluster.test members.0.% = 4
DS: data.aws_neptune_cluster.test enabled_cloudwatch_logs_exports.# = 1
DS: data.aws_neptune_cluster.test identifier = mycluster
DS: data.aws_neptune_cluster.test associated_roles.0.status = ACTIVE
DS: data.aws_neptune_cluster.test preferred_backup_window = 09:03-09:33
DS: data.aws_neptune_cluster.test members.# = 1
--- PASS: TestAccNeptuneClusterDataSource_basic (7.56s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/neptune    11.064s

@universalvishwa universalvishwa requested a review from a team as a code owner October 26, 2025 16:49
@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/neptune Issues and PRs that pertain to the neptune service. generators Relates to code generators. size/XL Managed by automation to categorize the size of a PR. labels Oct 26, 2025
@justinretzolk justinretzolk added new-data-source Introduces a new data source. and removed needs-triage Waiting for first response or review from a maintainer. labels Oct 28, 2025
@universalvishwa
Copy link
Author

@justinretzolk Can you help with getting some to review this PR? Thanks.

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. generators Relates to code generators. new-data-source Introduces a new data source. service/neptune Issues and PRs that pertain to the neptune 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.

[New Data Source]: Add aws_neptune_cluster data source

3 participants