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

Add connection_mode field to OpenSearch outbound connection resource #32990

Conversation

DanielRieske
Copy link
Contributor

Description

This PR adds a way to specify the connection mode (Direct or VPC Endpoint).

Adding this feature did present a challenge on how to output the VPC Endpoint URL.
This field is only set when the connection has been accepted and because this is currently done with a separate resource the aws_opensearch_inbound_acceptor, we can't reliably set this field.

To solve this issue, I added an additional parameter called accept_connection to merge the funtionality from the acceptor in this resource.

This offers the following benefits,

  • Reduces complexity of having multiple resources.
  • Have the endpoint field set immediately after creating the resource.

If this PR gets merged I will create an additional PR to deprecate the aws_opensearch_inbound_acceptor resource.
I can't remove it in this PR as it would introduce a breaking-change.

Relations

Closes: #32630

References

Output from Acceptance Testing

terraform-provider-aws git:(f-aws_opensearch_outbound_connection_mode_attribute) make testacc TESTS=TestAccOpenSearchOutboundConnection_ PKG=opensearch
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/opensearch/... -v -count 1 -parallel 20 -run='TestAccOpenSearchOutboundConnection_'  -timeout 180m
=== RUN   TestAccOpenSearchOutboundConnection_basic
=== PAUSE TestAccOpenSearchOutboundConnection_basic
=== RUN   TestAccOpenSearchOutboundConnection_vpc
=== PAUSE TestAccOpenSearchOutboundConnection_vpc
=== RUN   TestAccOpenSearchOutboundConnection_disappears
=== PAUSE TestAccOpenSearchOutboundConnection_disappears
=== CONT  TestAccOpenSearchOutboundConnection_basic
=== CONT  TestAccOpenSearchOutboundConnection_disappears
=== CONT  TestAccOpenSearchOutboundConnection_vpc
--- PASS: TestAccOpenSearchOutboundConnection_basic (2008.36s)
--- PASS: TestAccOpenSearchOutboundConnection_disappears (2040.62s)
--- PASS: TestAccOpenSearchOutboundConnection_vpc (2514.09s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/opensearch 2516.093s

...

@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 documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/opensearch Issues and PRs that pertain to the opensearch service. size/XL Managed by automation to categorize the size of a PR. labels Aug 14, 2023
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Aug 14, 2023
@DanielRieske DanielRieske marked this pull request as ready for review August 14, 2023 01:58
@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 Aug 14, 2023
@bschaatsbergen bschaatsbergen self-requested a review August 15, 2023 09:33
# Conflicts:
#	internal/service/opensearch/inbound_connection_accepter.go
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=TestAccOpenSearchOutboundConnection_' PKG=opensearch ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/opensearch/... -v -count 1 -parallel 2  -run=TestAccOpenSearchOutboundConnection_ -timeout 360m
=== RUN   TestAccOpenSearchOutboundConnection_basic
=== PAUSE TestAccOpenSearchOutboundConnection_basic
=== RUN   TestAccOpenSearchOutboundConnection_vpc
=== PAUSE TestAccOpenSearchOutboundConnection_vpc
=== RUN   TestAccOpenSearchOutboundConnection_disappears
=== PAUSE TestAccOpenSearchOutboundConnection_disappears
=== CONT  TestAccOpenSearchOutboundConnection_basic
=== CONT  TestAccOpenSearchOutboundConnection_disappears
--- PASS: TestAccOpenSearchOutboundConnection_disappears (2085.93s)
=== CONT  TestAccOpenSearchOutboundConnection_vpc
--- PASS: TestAccOpenSearchOutboundConnection_basic (2301.50s)
--- PASS: TestAccOpenSearchOutboundConnection_vpc (2808.15s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/opensearch	4899.251s

@ewbankkit
Copy link
Contributor

@DanielRieske Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit c15b512 into hashicorp:main Sep 26, 2023
41 checks passed
@github-actions github-actions bot added this to the v5.19.0 milestone Sep 26, 2023
@hashicorp hashicorp deleted a comment from github-actions bot Sep 26, 2023
@github-actions
Copy link

This functionality has been released in v5.19.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 Oct 29, 2023
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/opensearch Issues and PRs that pertain to the opensearch 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.

[Enhancement]: aws_opensearch_outbound_connection - add connection_mode configuration
3 participants