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

f/ add support for Neptune Serverless #27763

Conversation

thomasgouveia
Copy link
Contributor

@thomasgouveia thomasgouveia commented Nov 11, 2022

Description

This PR add the support of AWS Neptune Serverless.

It also add two validation functions for float types : FloatGreaterOrEqualThan and FloatLowerOrEqualThan.

Below is an example Terraform configuration to run a serverless Neptune cluster :

resource "aws_neptune_cluster" "example" {
  cluster_identifier                   = "neptune-cluster-development"
  engine                               = "neptune"

  # The `engine_version` must be set to 1.2.0.1 or above
  engine_version                       = "1.2.0.1"

  # The `neptune_cluster_parameter_group_name` must be a neptune1.2 cluster parameter group.
  neptune_cluster_parameter_group_name = "default.neptune1.2"

  skip_final_snapshot                  = true
  apply_immediately                    = true

  serverless_v2_scaling_configuration {
     min_capacity  = 2.5 # optional
     max_capacity = 128 # optional
  }
}

resource "aws_neptune_cluster_instance" "example" {
  cluster_identifier           = aws_neptune_cluster.example.cluster_identifier
  instance_class               = "db.serverless"
  neptune_parameter_group_name = "default.neptune1.2"
}

To enable Serverless, as AWS documentation explain it, we simply need to provide the new block serverless_v2_scaling_configuration in the aws_neptune_cluster resource.

This block has two attributes with default values :

  • min_capacity: default to 2.5
  • max_capacity: default to 128

See https://docs.aws.amazon.com/neptune/latest/userguide/neptune-serverless-capacity-scaling.html for more details about those attributes.

Relations

Closes #27622

References

https://docs.aws.amazon.com/neptune/latest/userguide/neptune-serverless-using.html#neptune-conversion-to-serverless
https://docs.aws.amazon.com/neptune/latest/userguide/neptune-serverless-capacity-scaling.html

Output from Acceptance Testing

$ make testacc TESTS=TestAccNeptuneCluster_serverlessConfiguration PKG=neptune

==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/neptune/... -v -count 1 -parallel 20 -run='TestAccNeptuneCluster_serverlessConfiguration'  -timeout 180m
=== RUN   TestAccNeptuneCluster_serverlessConfiguration
=== PAUSE TestAccNeptuneCluster_serverlessConfiguration
=== CONT  TestAccNeptuneCluster_serverlessConfiguration
--- PASS: TestAccNeptuneCluster_serverlessConfiguration (181.86s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/neptune    183.604s

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. service/neptune Issues and PRs that pertain to the neptune service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. verify Pertains to the verify package (i.e., provider-level validating, diff suppression, etc.) size/L Managed by automation to categorize the size of a PR. labels Nov 11, 2022
@github-actions
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 the documentation Introduces or discusses updates to documentation. label Nov 11, 2022
@thomasgouveia thomasgouveia force-pushed the f-add-support-for-neptune-serverless-27622 branch from 9fcb5db to d73f185 Compare November 11, 2022 12:56
@thomasgouveia thomasgouveia marked this pull request as ready for review November 11, 2022 12:57
@thomasgouveia thomasgouveia force-pushed the f-add-support-for-neptune-serverless-27622 branch from d73f185 to 9647899 Compare November 11, 2022 17:26
@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 Nov 11, 2022
@thomasgouveia thomasgouveia changed the title Add support for Neptune Serverless f/ add support for Neptune Serverless Nov 14, 2022
@github-actions github-actions bot removed the verify Pertains to the verify package (i.e., provider-level validating, diff suppression, etc.) label Nov 14, 2022
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=TestAccNeptuneCluster_serverlessConfiguration\|TestAccNeptuneCluster_basic' PKG=neptune ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/neptune/... -v -count 1 -parallel 2  -run=TestAccNeptuneCluster_serverlessConfiguration\|TestAccNeptuneCluster_basic -timeout 180m
=== RUN   TestAccNeptuneCluster_basic
=== PAUSE TestAccNeptuneCluster_basic
=== RUN   TestAccNeptuneCluster_serverlessConfiguration
=== PAUSE TestAccNeptuneCluster_serverlessConfiguration
=== CONT  TestAccNeptuneCluster_basic
=== CONT  TestAccNeptuneCluster_serverlessConfiguration
--- PASS: TestAccNeptuneCluster_serverlessConfiguration (168.81s)
--- PASS: TestAccNeptuneCluster_basic (168.91s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/neptune	176.125s

@ewbankkit
Copy link
Contributor

@thomasgouveia Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 3fe7c27 into hashicorp:main Nov 14, 2022
@github-actions github-actions bot added this to the v4.40.0 milestone Nov 14, 2022
@thomasgouveia
Copy link
Contributor Author

@ewbankkit you're welcome! :)

@github-actions
Copy link

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

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. service/neptune Issues and PRs that pertain to the neptune service. size/L 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 support for AWS Neptune Serverless
3 participants