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

r/aws_neptunegraph_graph: New Resource: Addition of Amazon Neptune Analytics Graph resource. #41216

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

triggan
Copy link
Contributor

@triggan triggan commented Feb 4, 2025

Description

This PR includes the addition of a new resource, aws_neptunegraph_graph. This defines the construct of an Amazon Neptune Analytics graph. This addresses issue #36806 . The implementation follows the definition in the issue, but with some small changes:

  • Added dynamic name support for graph_name where this will be generated if not defined.
  • Added support for graph_name_prefix for generation of names with a prefix (i.e. "tf-").
  • Added support for user-defined KMS keys (CMK). This is part of the API, but was not part of the original resource definition in the issue.

Noted oddities in development:

  • Unable to use nested attributes for vector_search_configuration due to limitation with framework protocol version 5 dependency on AWS provider. Implemented as a nested block, for now. Left code in comments for implementing this as an attribute should we ever move passed the v5 dependency.
  • AWS Provider docs suggest how to implement generated names though I could not get the examples in that doc to work. I deviated in the approach and ensured through testing that generated names still work given the various permutations of providing graph_name or graph_name_prefix (or none).
  • The Neptune Graph DeleteGraph API currently implements a skipSnapshot parameter that a user must provide before a graph can be deleted. The CloudFormation implementation of a Graph resources ignores this parameter and allows for deletion without a user specifying this parameter. I've decided to keep this behavior the same for the time being until we can address the discrepancy on the CFN/CDK side.

Relations

Closes #36806

References

Output from Acceptance Testing

% make testacc PKG=neptunegraph
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.5 test ./internal/service/neptunegraph/... -v -count 1 -parallel 20 -run='TestAccNeptuneGraphGraph_'  -timeout 360m -vet=off
2025/02/04 02:11:56 Initializing Terraform AWS Provider...
=== RUN   TestAccNeptuneGraphGraph_basic
=== PAUSE TestAccNeptuneGraphGraph_basic
=== RUN   TestAccNeptuneGraphGraph_disappears
=== PAUSE TestAccNeptuneGraphGraph_disappears
=== RUN   TestAccNeptuneGraphGraph_vectorSearch
=== PAUSE TestAccNeptuneGraphGraph_vectorSearch
=== RUN   TestAccNeptuneGraphGraph_kmsKey
=== PAUSE TestAccNeptuneGraphGraph_kmsKey
=== RUN   TestAccNeptuneGraphGraph_deletionProtection
=== PAUSE TestAccNeptuneGraphGraph_deletionProtection
=== RUN   TestAccNeptuneGraphGraph_nameGenerated
=== PAUSE TestAccNeptuneGraphGraph_nameGenerated
=== RUN   TestAccNeptuneGraphGraph_namePrefix
=== PAUSE TestAccNeptuneGraphGraph_namePrefix
=== RUN   TestAccNeptuneGraphGraph_tags
=== PAUSE TestAccNeptuneGraphGraph_tags
=== CONT  TestAccNeptuneGraphGraph_basic
=== CONT  TestAccNeptuneGraphGraph_deletionProtection
=== CONT  TestAccNeptuneGraphGraph_namePrefix
=== CONT  TestAccNeptuneGraphGraph_nameGenerated
=== CONT  TestAccNeptuneGraphGraph_vectorSearch
=== CONT  TestAccNeptuneGraphGraph_kmsKey
=== CONT  TestAccNeptuneGraphGraph_disappears
=== CONT  TestAccNeptuneGraphGraph_tags
--- PASS: TestAccNeptuneGraphGraph_tags (528.38s)
--- PASS: TestAccNeptuneGraphGraph_namePrefix (597.62s)
--- PASS: TestAccNeptuneGraphGraph_basic (487.78s)
--- PASS: TestAccNeptuneGraphGraph_vectorSearch (520.85s)
--- PASS: TestAccNeptuneGraphGraph_disappears (554.14s)
--- PASS: TestAccNeptuneGraphGraph_nameGenerated (555.74s)
--- PASS: TestAccNeptuneGraphGraph_deletionProtection (635.21s)
--- PASS: TestAccNeptuneGraphGraph_kmsKey (647.38s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/neptunegraph       651.836s

@triggan triggan requested a review from a team as a code owner February 4, 2025 04:23
Copy link

github-actions bot commented Feb 4, 2025

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 documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. tags Pertains to resource tagging. generators Relates to code generators. service/neptunegraph Issues and PRs that pertain to the neptunegraph service. needs-triage Waiting for first response or review from a maintainer. partner Contribution from a partner. labels Feb 4, 2025
@ewbankkit ewbankkit added new-resource Introduces a new resource. and removed needs-triage Waiting for first response or review from a maintainer. labels Feb 4, 2025
@triggan
Copy link
Contributor Author

triggan commented Feb 4, 2025

Noted build errors on terrafmt, lint, and docs formatting. Working to address issues.

@triggan
Copy link
Contributor Author

triggan commented Feb 4, 2025

@ewbankkit - I'm still getting an odd lint failure. It's complaining about an extra newline character on line 371 of graph.go, but I'm not seeing that on my end. Everything else has been addressed. One final run of acceptance tests below:

make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.5 test ./internal/service/neptunegraph/... -v -count 1 -parallel 20   -timeout 360m -vet=off
2025/02/04 16:17:17 Initializing Terraform AWS Provider...
=== RUN   TestAccNeptuneGraphGraph_basic
=== PAUSE TestAccNeptuneGraphGraph_basic
=== RUN   TestAccNeptuneGraphGraph_disappears
=== PAUSE TestAccNeptuneGraphGraph_disappears
=== RUN   TestAccNeptuneGraphGraph_vectorSearch
=== PAUSE TestAccNeptuneGraphGraph_vectorSearch
=== RUN   TestAccNeptuneGraphGraph_kmsKey
=== PAUSE TestAccNeptuneGraphGraph_kmsKey
=== RUN   TestAccNeptuneGraphGraph_deletionProtection
=== PAUSE TestAccNeptuneGraphGraph_deletionProtection
=== RUN   TestAccNeptuneGraphGraph_nameGenerated
=== PAUSE TestAccNeptuneGraphGraph_nameGenerated
=== RUN   TestAccNeptuneGraphGraph_namePrefix
=== PAUSE TestAccNeptuneGraphGraph_namePrefix
=== RUN   TestAccNeptuneGraphGraph_tags
=== PAUSE TestAccNeptuneGraphGraph_tags
=== CONT  TestAccNeptuneGraphGraph_basic
=== CONT  TestAccNeptuneGraphGraph_deletionProtection
=== CONT  TestAccNeptuneGraphGraph_tags
=== CONT  TestAccNeptuneGraphGraph_namePrefix
=== CONT  TestAccNeptuneGraphGraph_nameGenerated
=== CONT  TestAccNeptuneGraphGraph_vectorSearch
=== CONT  TestAccNeptuneGraphGraph_kmsKey
=== CONT  TestAccNeptuneGraphGraph_disappears
--- PASS: TestAccNeptuneGraphGraph_vectorSearch (506.25s)
--- PASS: TestAccNeptuneGraphGraph_kmsKey (507.58s)
--- PASS: TestAccNeptuneGraphGraph_nameGenerated (563.33s)
--- PASS: TestAccNeptuneGraphGraph_basic (590.72s)
--- PASS: TestAccNeptuneGraphGraph_disappears (593.05s)
--- PASS: TestAccNeptuneGraphGraph_deletionProtection (619.63s)
--- PASS: TestAccNeptuneGraphGraph_tags (639.07s)
--- PASS: TestAccNeptuneGraphGraph_namePrefix (647.95s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/neptunegraph       648.145s

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-resource Introduces a new resource. partner Contribution from a partner. service/neptunegraph Issues and PRs that pertain to the neptunegraph service. tags Pertains to resource tagging. 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 Resource]: aws_neptunegraph_graph
2 participants