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_vpc_endpoint_private_dns: new resource #37628

Merged
merged 1 commit into from
May 23, 2024
Merged

Conversation

jar-b
Copy link
Member

@jar-b jar-b commented May 21, 2024

Description

This resource will allow practitioners to enable and disable private DNS for a VPC endpoint.

This allows private DNS to be enabled on the VPC endpoint distinctly from the initial create operation, supporting use cases where additional actions must be taken between creation of the endpoint and enabling of private DNS.

resource "aws_vpc_endpoint" "test" {
  vpc_id            = aws_vpc.test.id
  service_name      = "producer service name"
  vpc_endpoint_type = "Interface"
}

# Some intermediate action can take place here, such as accepting
# an endpoint connection request.
resource "aws_vpc_endpoint_connection_accepter" "test" {
  vpc_endpoint_service_id = "producer service id"
  vpc_endpoint_id         = aws_vpc_endpoint.test.id
}

# Once the intermediate action is complete, private DNS can be enabled
# within the same apply.
resource "aws_vpc_endpoint_private_dns" "test" {
  depends_on = [aws_vpc_endpoint_connection_accepter.test]

  vpc_endpoint_id     = aws_vpc_endpoint.test.id
  private_dns_enabled = true
}

Relations

Closes #7148

References

Output from Acceptance Testing

% make testacc PKG=ec2 TESTS="TestAccVPCEndpointPrivateDNS_"
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.2 test ./internal/service/ec2/... -v -count 1 -parallel 20 -run='TestAccVPCEndpointPrivateDNS_'  -timeout 360m

--- PASS: TestAccVPCEndpointPrivateDNS_disappears_Endpoint (127.05s)
--- PASS: TestAccVPCEndpointPrivateDNS_basic (167.16s)
--- PASS: TestAccVPCEndpointPrivateDNS_update (167.83s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/ec2        172.994s

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 size/XL Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. generators Relates to code generators. service/vpc Issues and PRs that pertain to the vpc service. labels May 21, 2024
@terraform-aws-provider terraform-aws-provider bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label May 21, 2024
@jar-b jar-b marked this pull request as draft May 21, 2024 19:01
@jar-b jar-b force-pushed the f-vpc_endpoint_private_dns branch 2 times, most recently from 9690cfb to dc0533c Compare May 21, 2024 19:08
This resource will allow practitioners to enable and disable private DNS for a VPC endpoint.

This allows private DNS to be enabled on the VPC endpoint distinctly from the initial create operation, supporting use cases where additional actions must be taken between creation of the endpoint and enabling of private DNS.

```terraform
resource "aws_vpc_endpoint" "test" {
  vpc_id            = aws_vpc.test.id
  service_name      = "producer service name"
  vpc_endpoint_type = "Interface"
}

resource "aws_vpc_endpoint_connection_accepter" "test" {
  vpc_endpoint_service_id = "producer service id"
  vpc_endpoint_id         = aws_vpc_endpoint.test.id
}

resource "aws_vpc_endpoint_private_dns" "test" {
  depends_on = [aws_vpc_endpoint_connection_accepter.test]

  vpc_endpoint_id     = aws_vpc_endpoint.test.id
  private_dns_enabled = true
}
```

```console
% make testacc PKG=ec2 TESTS="TestAccVPCEndpointPrivateDNS_"
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.2 test ./internal/service/ec2/... -v -count 1 -parallel 20 -run='TestAccVPCEndpointPrivateDNS_'  -timeout 360m

--- PASS: TestAccVPCEndpointPrivateDNS_disappears_Endpoint (127.05s)
--- PASS: TestAccVPCEndpointPrivateDNS_basic (167.16s)
--- PASS: TestAccVPCEndpointPrivateDNS_update (167.83s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/ec2        172.994s
```
@jar-b jar-b force-pushed the f-vpc_endpoint_private_dns branch from dc0533c to 7a03500 Compare May 21, 2024 19:18
@jar-b jar-b marked this pull request as ready for review May 21, 2024 19:40
Copy link
Contributor

@johnsonaj johnsonaj 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=TestAccVPCEndpointPrivateDNS_" PKG=ec2

==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.2 test ./internal/service/ec2/... -v -count 1 -parallel 20  -run=TestAccVPCEndpointPrivateDNS_ -timeout 360m
--- PASS: TestAccVPCEndpointPrivateDNS_update (147.14s)
--- PASS: TestAccVPCEndpointPrivateDNS_basic (149.55s)
--- PASS: TestAccVPCEndpointPrivateDNS_disappears_Endpoint (157.96s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	163.744s

@jar-b jar-b merged commit 27f7195 into main May 23, 2024
53 checks passed
@jar-b jar-b deleted the f-vpc_endpoint_private_dns branch May 23, 2024 15:18
@github-actions github-actions bot added this to the v5.51.0 milestone May 23, 2024
github-actions bot pushed a commit that referenced this pull request May 23, 2024
Copy link

This functionality has been released in v5.51.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 github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label May 24, 2024
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 Jun 26, 2024
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. generators Relates to code generators. service/vpc Issues and PRs that pertain to the vpc 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.

vpc_endpoint creation should enable Private DNS only after endpoint creation
2 participants