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

Requester-managed Interface VPC Endpoints #8396

Closed
wants to merge 4 commits into from

Conversation

ewbankkit
Copy link
Contributor

@ewbankkit ewbankkit commented Apr 20, 2019

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

Fixes #8386.

Release note for CHANGELOG:

ENHANCEMENTS:

* data-source/aws_vpc_endpoint: New exported attribute `requester_managed` (https://github.com/terraform-providers/terraform-provider-aws/issues/8386).
* data-source/aws_vpc_endpoint_service: New exported attribute `manages_vpc_endpoints` (https://github.com/terraform-providers/terraform-provider-aws/issues/8386).
* resource/aws_vpc_endpoint: New exported attribute `requester_managed` (https://github.com/terraform-providers/terraform-provider-aws/issues/8386).
* resource/aws_vpc_endpoint_service: New exported attribute `manages_vpc_endpoints` (https://github.com/terraform-providers/terraform-provider-aws/issues/8386).

Acceptance tests:

d/aws_vpc_endpoint_service

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccDataSourceAwsVpcEndpointService_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -parallel 20 -run=TestAccDataSourceAwsVpcEndpointService_ -timeout 120m
=== RUN   TestAccDataSourceAwsVpcEndpointService_gateway
=== PAUSE TestAccDataSourceAwsVpcEndpointService_gateway
=== RUN   TestAccDataSourceAwsVpcEndpointService_interface
=== PAUSE TestAccDataSourceAwsVpcEndpointService_interface
=== RUN   TestAccDataSourceAwsVpcEndpointService_custom
=== PAUSE TestAccDataSourceAwsVpcEndpointService_custom
=== CONT  TestAccDataSourceAwsVpcEndpointService_gateway
=== CONT  TestAccDataSourceAwsVpcEndpointService_custom
=== CONT  TestAccDataSourceAwsVpcEndpointService_interface
--- PASS: TestAccDataSourceAwsVpcEndpointService_interface (17.36s)
--- PASS: TestAccDataSourceAwsVpcEndpointService_gateway (17.41s)
--- PASS: TestAccDataSourceAwsVpcEndpointService_custom (263.78s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	263.804s

r/aws_vpc_endpoint_service

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSVpcEndpointService_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -parallel 20 -run=TestAccAWSVpcEndpointService_ -timeout 120m
=== RUN   TestAccAWSVpcEndpointService_basic
=== PAUSE TestAccAWSVpcEndpointService_basic
=== RUN   TestAccAWSVpcEndpointService_removed
=== PAUSE TestAccAWSVpcEndpointService_removed
=== CONT  TestAccAWSVpcEndpointService_basic
=== CONT  TestAccAWSVpcEndpointService_removed
--- PASS: TestAccAWSVpcEndpointService_removed (244.82s)
--- PASS: TestAccAWSVpcEndpointService_basic (491.29s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	491.320s

d/aws_vpc_endpoint

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccDataSourceAwsVpcEndpoint_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -parallel 20 -run=TestAccDataSourceAwsVpcEndpoint_ -timeout 120m
=== RUN   TestAccDataSourceAwsVpcEndpoint_gatewayBasic
=== PAUSE TestAccDataSourceAwsVpcEndpoint_gatewayBasic
=== RUN   TestAccDataSourceAwsVpcEndpoint_byId
=== PAUSE TestAccDataSourceAwsVpcEndpoint_byId
=== RUN   TestAccDataSourceAwsVpcEndpoint_gatewayWithRouteTable
=== PAUSE TestAccDataSourceAwsVpcEndpoint_gatewayWithRouteTable
=== RUN   TestAccDataSourceAwsVpcEndpoint_interface
=== PAUSE TestAccDataSourceAwsVpcEndpoint_interface
=== CONT  TestAccDataSourceAwsVpcEndpoint_gatewayBasic
=== CONT  TestAccDataSourceAwsVpcEndpoint_interface
=== CONT  TestAccDataSourceAwsVpcEndpoint_gatewayWithRouteTable
=== CONT  TestAccDataSourceAwsVpcEndpoint_byId
--- PASS: TestAccDataSourceAwsVpcEndpoint_gatewayBasic (44.76s)
--- PASS: TestAccDataSourceAwsVpcEndpoint_byId (44.80s)
--- PASS: TestAccDataSourceAwsVpcEndpoint_gatewayWithRouteTable (48.22s)
--- PASS: TestAccDataSourceAwsVpcEndpoint_interface (184.66s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	184.690s

r/aws_vpc_endpoint

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSVpcEndpoint_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -parallel 20 -run=TestAccAWSVpcEndpoint_ -timeout 120m
=== RUN   TestAccAWSVpcEndpoint_gatewayBasic
=== PAUSE TestAccAWSVpcEndpoint_gatewayBasic
=== RUN   TestAccAWSVpcEndpoint_gatewayWithRouteTableAndPolicy
=== PAUSE TestAccAWSVpcEndpoint_gatewayWithRouteTableAndPolicy
=== RUN   TestAccAWSVpcEndpoint_gatewayPolicy
=== PAUSE TestAccAWSVpcEndpoint_gatewayPolicy
=== RUN   TestAccAWSVpcEndpoint_interfaceBasic
=== PAUSE TestAccAWSVpcEndpoint_interfaceBasic
=== RUN   TestAccAWSVpcEndpoint_interfaceWithSubnetAndSecurityGroup
=== PAUSE TestAccAWSVpcEndpoint_interfaceWithSubnetAndSecurityGroup
=== RUN   TestAccAWSVpcEndpoint_interfaceNonAWSService
=== PAUSE TestAccAWSVpcEndpoint_interfaceNonAWSService
=== RUN   TestAccAWSVpcEndpoint_removed
=== PAUSE TestAccAWSVpcEndpoint_removed
=== CONT  TestAccAWSVpcEndpoint_gatewayBasic
=== CONT  TestAccAWSVpcEndpoint_removed
=== CONT  TestAccAWSVpcEndpoint_interfaceNonAWSService
=== CONT  TestAccAWSVpcEndpoint_interfaceWithSubnetAndSecurityGroup
=== CONT  TestAccAWSVpcEndpoint_interfaceBasic
=== CONT  TestAccAWSVpcEndpoint_gatewayPolicy
=== CONT  TestAccAWSVpcEndpoint_gatewayWithRouteTableAndPolicy
--- PASS: TestAccAWSVpcEndpoint_removed (37.15s)
--- PASS: TestAccAWSVpcEndpoint_gatewayBasic (44.24s)
--- PASS: TestAccAWSVpcEndpoint_interfaceBasic (60.38s)
--- PASS: TestAccAWSVpcEndpoint_gatewayPolicy (71.08s)
--- PASS: TestAccAWSVpcEndpoint_gatewayWithRouteTableAndPolicy (86.65s)
--- PASS: TestAccAWSVpcEndpoint_interfaceNonAWSService (320.69s)
--- PASS: TestAccAWSVpcEndpoint_interfaceWithSubnetAndSecurityGroup (374.05s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	374.092s

@ghost ghost added size/XXL Managed by automation to categorize the size of a PR. service/ec2 Issues and PRs that pertain to the ec2 service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. documentation Introduces or discusses updates to documentation. labels Apr 20, 2019
@@ -201,7 +205,70 @@ func resourceAwsVpcEndpointRead(d *schema.ResourceData, meta interface{}) error
return nil
}

return vpcEndpointAttributes(d, vpce.(*ec2.VpcEndpoint), conn)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace call to vpcEndpointAttributes() with explicit setting of attributes (including new requester_managed attribute).

d.SetId(aws.StringValue(vpce.VpcEndpointId))

return vpcEndpointAttributes(d, vpce, conn)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace call to vpcEndpointAttributes() with explicit setting of attributes (including new requester_managed attribute), see also https://github.com/terraform-providers/terraform-provider-aws/pull/8396/files#r277149439.

@@ -367,72 +434,6 @@ func vpcEndpointWaitUntilDeleted(conn *ec2.EC2, vpceId string, timeout time.Dura
return err
}

func vpcEndpointAttributes(d *schema.ResourceData, vpce *ec2.VpcEndpoint, conn *ec2.EC2) error {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -115,7 +119,39 @@ func resourceAwsVpcEndpointServiceRead(d *schema.ResourceData, meta interface{})
return nil
}

return vpcEndpointServiceAttributes(d, svcCfg.(*ec2.ServiceConfiguration), conn)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace call to vpcEndpointServiceAttributes() with explicit setting of attributes (including new manages_vpc_endpoints attribute).

@@ -242,27 +278,6 @@ func waitForVpcEndpointServiceDeletion(conn *ec2.EC2, serviceID string) error {
return err
}

func vpcEndpointServiceAttributes(d *schema.ResourceData, svcCfg *ec2.ServiceConfiguration, conn *ec2.EC2) error {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ewbankkit
Copy link
Contributor Author

Rebased to remove merge conflict.

@ewbankkit
Copy link
Contributor Author

This has minor functionality updates, most of the changes are cleaning up the acceptance tests.

@ewbankkit
Copy link
Contributor Author

Rebased to remove conflicts and also ran terrafmt on new changes.

Acceptance tests:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSVpcEndpoint_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -parallel 4 -run=TestAccAWSVpcEndpoint_ -timeout 120m
=== RUN   TestAccAWSVpcEndpoint_gatewayBasic
=== PAUSE TestAccAWSVpcEndpoint_gatewayBasic
=== RUN   TestAccAWSVpcEndpoint_gatewayWithRouteTableAndPolicy
=== PAUSE TestAccAWSVpcEndpoint_gatewayWithRouteTableAndPolicy
=== RUN   TestAccAWSVpcEndpoint_gatewayPolicy
=== PAUSE TestAccAWSVpcEndpoint_gatewayPolicy
=== RUN   TestAccAWSVpcEndpoint_interfaceBasic
=== PAUSE TestAccAWSVpcEndpoint_interfaceBasic
=== RUN   TestAccAWSVpcEndpoint_interfaceWithSubnetAndSecurityGroup
=== PAUSE TestAccAWSVpcEndpoint_interfaceWithSubnetAndSecurityGroup
=== RUN   TestAccAWSVpcEndpoint_interfaceNonAWSService
=== PAUSE TestAccAWSVpcEndpoint_interfaceNonAWSService
=== RUN   TestAccAWSVpcEndpoint_removed
=== PAUSE TestAccAWSVpcEndpoint_removed
=== CONT  TestAccAWSVpcEndpoint_gatewayBasic
=== CONT  TestAccAWSVpcEndpoint_interfaceBasic
=== CONT  TestAccAWSVpcEndpoint_interfaceWithSubnetAndSecurityGroup
=== CONT  TestAccAWSVpcEndpoint_removed
--- PASS: TestAccAWSVpcEndpoint_removed (37.77s)
=== CONT  TestAccAWSVpcEndpoint_interfaceNonAWSService
--- PASS: TestAccAWSVpcEndpoint_gatewayBasic (44.91s)
=== CONT  TestAccAWSVpcEndpoint_gatewayPolicy
--- PASS: TestAccAWSVpcEndpoint_interfaceBasic (72.89s)
=== CONT  TestAccAWSVpcEndpoint_gatewayWithRouteTableAndPolicy
--- PASS: TestAccAWSVpcEndpoint_gatewayPolicy (74.24s)
--- PASS: TestAccAWSVpcEndpoint_gatewayWithRouteTableAndPolicy (81.93s)
--- PASS: TestAccAWSVpcEndpoint_interfaceNonAWSService (296.19s)
--- PASS: TestAccAWSVpcEndpoint_interfaceWithSubnetAndSecurityGroup (381.25s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	381.322s
$ make testacc TEST=./aws/ TESTARGS='-run=TestAccDataSourceAwsVpcEndpoint_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -parallel 20 -run=TestAccDataSourceAwsVpcEndpoint_ -timeout 120m
=== RUN   TestAccDataSourceAwsVpcEndpoint_gatewayBasic
=== PAUSE TestAccDataSourceAwsVpcEndpoint_gatewayBasic
=== RUN   TestAccDataSourceAwsVpcEndpoint_byId
=== PAUSE TestAccDataSourceAwsVpcEndpoint_byId
=== RUN   TestAccDataSourceAwsVpcEndpoint_gatewayWithRouteTable
=== PAUSE TestAccDataSourceAwsVpcEndpoint_gatewayWithRouteTable
=== RUN   TestAccDataSourceAwsVpcEndpoint_interface
=== PAUSE TestAccDataSourceAwsVpcEndpoint_interface
=== CONT  TestAccDataSourceAwsVpcEndpoint_gatewayBasic
=== CONT  TestAccDataSourceAwsVpcEndpoint_gatewayWithRouteTable
=== CONT  TestAccDataSourceAwsVpcEndpoint_byId
=== CONT  TestAccDataSourceAwsVpcEndpoint_interface
--- PASS: TestAccDataSourceAwsVpcEndpoint_byId (46.71s)
--- PASS: TestAccDataSourceAwsVpcEndpoint_gatewayBasic (48.44s)
--- PASS: TestAccDataSourceAwsVpcEndpoint_gatewayWithRouteTable (50.35s)
--- PASS: TestAccDataSourceAwsVpcEndpoint_interface (188.60s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	188.668s
$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSVpcEndpointService_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -parallel 20 -run=TestAccAWSVpcEndpointService_ -timeout 120m
=== RUN   TestAccAWSVpcEndpointService_basic
=== PAUSE TestAccAWSVpcEndpointService_basic
=== RUN   TestAccAWSVpcEndpointService_removed
=== PAUSE TestAccAWSVpcEndpointService_removed
=== CONT  TestAccAWSVpcEndpointService_basic
=== CONT  TestAccAWSVpcEndpointService_removed
--- PASS: TestAccAWSVpcEndpointService_removed (270.09s)
--- PASS: TestAccAWSVpcEndpointService_basic (446.31s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	446.379s
$ make testacc TEST=./aws/ TESTARGS='-run=TestAccDataSourceAwsVpcEndpointService_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -parallel 20 -run=TestAccDataSourceAwsVpcEndpointService_ -timeout 120m
=== RUN   TestAccDataSourceAwsVpcEndpointService_gateway
=== PAUSE TestAccDataSourceAwsVpcEndpointService_gateway
=== RUN   TestAccDataSourceAwsVpcEndpointService_interface
=== PAUSE TestAccDataSourceAwsVpcEndpointService_interface
=== RUN   TestAccDataSourceAwsVpcEndpointService_custom
=== PAUSE TestAccDataSourceAwsVpcEndpointService_custom
=== CONT  TestAccDataSourceAwsVpcEndpointService_gateway
=== CONT  TestAccDataSourceAwsVpcEndpointService_interface
=== CONT  TestAccDataSourceAwsVpcEndpointService_custom
--- PASS: TestAccDataSourceAwsVpcEndpointService_interface (17.79s)
--- PASS: TestAccDataSourceAwsVpcEndpointService_gateway (17.81s)
--- PASS: TestAccDataSourceAwsVpcEndpointService_custom (286.47s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	286.538s

@bflad bflad added the enhancement Requests to existing resources that expand the functionality or scope. label Jun 20, 2019
@bflad bflad added this to the v2.16.0 milestone Jun 20, 2019
@bflad
Copy link
Contributor

bflad commented Jun 20, 2019

Merged as part of #8674 🚀

@bflad bflad closed this Jun 20, 2019
bflad added a commit that referenced this pull request Jun 20, 2019
@ewbankkit ewbankkit deleted the issue-8386 branch June 20, 2019 11:33
@bflad
Copy link
Contributor

bflad commented Jun 20, 2019

This has been released in version 2.16.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link

ghost commented Nov 3, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Nov 3, 2019
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/ec2 Issues and PRs that pertain to the ec2 service. size/XXL 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.

Support requester-managed Interface VPC Endpoints
2 participants