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

Support AWS PrivateLink #2515

Closed
wants to merge 4 commits into from
Closed

Conversation

ewbankkit
Copy link
Contributor

@ewbankkit ewbankkit commented Dec 1, 2017

Fixes #2222 and #2460.
Incorporates #2253.

  • aws_vpc_endpoint_service data source - Update
  • aws_vpc_endpoint data source - Update
  • aws_vpc_endpoint resource - Update
  • aws_vpc_endpoint_subnet_association resource - New
  • aws_vpc_endpoint_service resource - New
  • aws_vpc_endpoint_service_allowed_principal resource - New
  • aws_vpc_endpoint_connection_notification resource - New
  • aws_vpc_endpoint_service data source - Update
  • Documentation
  • Acceptance tests

@ewbankkit
Copy link
Contributor Author

Initial commits are just an excuse to write down a task list 😄.

@radeksimko radeksimko added the new-resource Introduces a new resource. label Dec 2, 2017
@ewbankkit
Copy link
Contributor Author

There will be no aws_vpc_endpoint_connection_accepter resource as my initial understanding of VPC endpoint connection acceptance was wrong. I think we can add an auto_accept attribute to the aws_vpc_endpoint resource to accept the endpoint connection if the endpoint service is in the same account.

@darrenhaken
Copy link
Contributor

Any idea when this might be complete?

@ewbankkit
Copy link
Contributor Author

Need to complete the aws_vpc_endpoint_connection_notification and then make some updates to the aws_vpc_endpoint resource and aws_vpc_endpoint/aws_vpc_endpoint_service data sources.
May well need to merge #2253 in and submit the combined PR for completeness.
Don't want to make promises, but shouldn't be too long.

@darrenhaken
Copy link
Contributor

darrenhaken commented Dec 6, 2017 via email

@ewbankkit ewbankkit changed the title [WIP] Support AWS PrivateLink for Private Connectivity [WIP] Support AWS PrivateLink Dec 10, 2017
@ewbankkit
Copy link
Contributor Author

The PR now incorporates the work done in #2253 and support AWS Private Link for both AWS and non-AWS (user defined) services.
I made the decision to combine as completing the non-AWS service work completely built on the work in #2253.

The aws_vpc_endpoint_service has been added as the resource through which non-AWS VPC Endpoint Services are managed.
The associated aws_vpc_endpoint_service_allowed_principal allows whitelisted resources to be added or removed independent of the main resource (e.g. in a separate Terraform state).

In addition to the changes in #2253, the aws_vpc_endpoint resource has been enhanced with the auto_accept attribute which allows a same-account non-AWS VPC Endpoint to be accepted.

@ewbankkit
Copy link
Contributor Author

ewbankkit commented Dec 10, 2017

Acceptance tests:

aws_vpc_endpoint_service data source:

make testacc TEST=./aws/ TESTARGS='-run=TestAccDataSourceAwsVpcEndpointService_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -run=TestAccDataSourceAwsVpcEndpointService_ -timeout 120m
=== RUN   TestAccDataSourceAwsVpcEndpointService_gateway
--- PASS: TestAccDataSourceAwsVpcEndpointService_gateway (14.77s)
=== RUN   TestAccDataSourceAwsVpcEndpointService_interface
--- PASS: TestAccDataSourceAwsVpcEndpointService_interface (13.73s)
=== RUN   TestAccDataSourceAwsVpcEndpointService_custom
--- PASS: TestAccDataSourceAwsVpcEndpointService_custom (240.52s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	269.032s

aws_vpc_endpoint data source:

make testacc TEST=./aws/ TESTARGS='-run=TestAccDataSourceAwsVpcEndpoint_'
make testacc TEST=./aws/ TESTARGS='-run=TestAccDataSourceAwsVpcEndpoint_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -run=TestAccDataSourceAwsVpcEndpoint_ -timeout 120m
=== RUN   TestAccDataSourceAwsVpcEndpoint_gatewayBasic
--- PASS: TestAccDataSourceAwsVpcEndpoint_gatewayBasic (44.07s)
=== RUN   TestAccDataSourceAwsVpcEndpoint_byId
--- PASS: TestAccDataSourceAwsVpcEndpoint_byId (43.84s)
=== RUN   TestAccDataSourceAwsVpcEndpoint_gatewayWithRouteTable
--- PASS: TestAccDataSourceAwsVpcEndpoint_gatewayWithRouteTable (47.68s)
=== RUN   TestAccDataSourceAwsVpcEndpoint_interface
--- PASS: TestAccDataSourceAwsVpcEndpoint_interface (282.24s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	417.844s

aws_vpc_endpoint_service resource:

make testacc TEST=./aws/ TESTARGS='-run=TestAccAwsVpcEndpointService_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -run=TestAccAwsVpcEndpointService_ -timeout 120m
=== RUN   TestAccAwsVpcEndpointService_importBasic
--- PASS: TestAccAwsVpcEndpointService_importBasic (222.59s)
=== RUN   TestAccAwsVpcEndpointService_basic
--- PASS: TestAccAwsVpcEndpointService_basic (395.80s)
=== RUN   TestAccAwsVpcEndpointService_removed
--- PASS: TestAccAwsVpcEndpointService_removed (243.92s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	862.326s

aws_vpc_endpoint_service_allowed_principal resource:

make testacc TEST=./aws/ TESTARGS='-run=TestAccAwsVpcEndpointServiceAllowedPrincipal_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -run=TestAccAwsVpcEndpointServiceAllowedPrincipal_ -timeout 120m
=== RUN   TestAccAwsVpcEndpointServiceAllowedPrincipal_basic
--- PASS: TestAccAwsVpcEndpointServiceAllowedPrincipal_basic (233.62s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	233.631s

aws_vpc_endpoint resource:

make testacc TEST=./aws/ TESTARGS='-run=TestAccAwsVpcEndpoint_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -run=TestAccAwsVpcEndpoint_ -timeout 120m
=== RUN   TestAccAwsVpcEndpoint_importBasic
--- PASS: TestAccAwsVpcEndpoint_importBasic (44.37s)
=== RUN   TestAccAwsVpcEndpoint_gatewayBasic
--- PASS: TestAccAwsVpcEndpoint_gatewayBasic (39.30s)
=== RUN   TestAccAwsVpcEndpoint_gatewayWithRouteTableAndPolicy
--- PASS: TestAccAwsVpcEndpoint_gatewayWithRouteTableAndPolicy (73.09s)
=== RUN   TestAccAwsVpcEndpoint_interfaceBasic
--- PASS: TestAccAwsVpcEndpoint_interfaceBasic (58.46s)
=== RUN   TestAccAwsVpcEndpoint_interfaceWithSubnetAndSecurityGroup
--- PASS: TestAccAwsVpcEndpoint_interfaceWithSubnetAndSecurityGroup (383.52s)
=== RUN   TestAccAwsVpcEndpoint_interfaceNonAWSService
--- PASS: TestAccAwsVpcEndpoint_interfaceNonAWSService (290.49s)
=== RUN   TestAccAwsVpcEndpoint_removed
--- PASS: TestAccAwsVpcEndpoint_removed (32.10s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	921.354s

aws_vpc_endpoint_route_table_association resource:

make testacc TEST=./aws/ TESTARGS='-run=TestAccAwsVpcEndpointRouteTableAssociation_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -run=TestAccAwsVpcEndpointRouteTableAssociation_ -timeout 120m
=== RUN   TestAccAwsVpcEndpointRouteTableAssociation_basic
--- PASS: TestAccAwsVpcEndpointRouteTableAssociation_basic (42.73s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	42.743s

aws_vpc_endpoint_subnet_association resource:

make testacc TEST=./aws/ TESTARGS='-run=TestAccAwsVpcEndpointSubnetAssociation_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -run=TestAccAwsVpcEndpointSubnetAssociation_ -timeout 120m
=== RUN   TestAccAwsVpcEndpointSubnetAssociation_basic
--- PASS: TestAccAwsVpcEndpointSubnetAssociation_basic (129.30s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	129.316s

aws_vpc_endpoint_connection_notification resource:

make testacc TEST=./aws/ TESTARGS='-run=TestAccAwsVpcEndpointConnectionNotification_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -run=TestAccAwsVpcEndpointConnectionNotification_ -timeout 120m
=== RUN   TestAccAwsVpcEndpointConnectionNotification_importBasic
--- PASS: TestAccAwsVpcEndpointConnectionNotification_importBasic (244.87s)
=== RUN   TestAccAwsVpcEndpointConnectionNotification_basic
--- PASS: TestAccAwsVpcEndpointConnectionNotification_basic (265.81s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	510.696s

@ewbankkit ewbankkit changed the title [WIP] Support AWS PrivateLink Support AWS PrivateLink Dec 11, 2017
@ewbankkit
Copy link
Contributor Author

Removed WIP.

@RyanJarv
Copy link
Contributor

RyanJarv commented Dec 22, 2017

Hey awesome work! Quick observation here, allowed_principals on aws_vpc_endpoint_service doesn't seem to be updated if it is removed in terraform (whitelisted principals stay whitelisted on the endpoint service).

@jen20 jen20 self-assigned this Dec 29, 2017
@skeller88
Copy link

Any update on when this might be merged? I'm also eagerly awaiting a fix.

@ewbankkit
Copy link
Contributor Author

ewbankkit commented Jan 7, 2018

@RyanJarv By "removed in terraform" do you mean that you removed the allowed_principals attribute (in which case Terraform will no longer manage that value as it's marked as Computed) or set it to the empty list: allowed_principals = []?

allowed_principals is Computed as the set of principals can either be managed via the aws_vpc_endpoint_service resource's allowed_principals attribute or via the aws_vpc_endpoint_service_allowed_principal resource.

@radeksimko radeksimko added enhancement Requests to existing resources that expand the functionality or scope. service/ec2 Issues and PRs that pertain to the ec2 service. labels Jan 16, 2018
@RyanJarv
Copy link
Contributor

@ewbankkit looks like I was removing allowed_principals. Setting it to an empty array behaves as expected.

@ewbankkit
Copy link
Contributor Author

Rebased to fix conflicts.

@tombooth
Copy link

@jen20 @radeksimko what's holding this up? having to run a forked version of this provider for the moment

@jen20
Copy link
Contributor

jen20 commented Jan 26, 2018

My mistake, I've been busy with other things. I'll try to pick this up today unless another maintainer does before me.

@sverze
Copy link

sverze commented Jan 27, 2018

Any ETA on when this will be merged?

opetch pushed a commit to opetch/terraform-provider-aws that referenced this pull request Jan 29, 2018
Add documentation for aws_vpc_endpoint_service and aws_vpc_endpoint_service_allowed_principal resources.

Normalize 'not found' resource log lines on read.

Use 'ConflictsWith' in schema.

Use 'helper/validation' package to avoid frequent 'validators.go' conflicts.
@stevenayers
Copy link
Contributor

@jen20 @radeksimko Any ETA on when this'll be merged? Thanks.

@kjmancuso
Copy link

@jen20
Copy link
Contributor

jen20 commented Feb 3, 2018

I've rebased and merged this locallly, and it looks good to go - it landed in 35b273e. Thanks for a great PR @ewbankkit.

Sorry for the delay on merging this, but I have limited time to work on outside projects such as Terraform these days.

@bflad
Copy link
Contributor

bflad commented Feb 9, 2018

This has been released in terraform-provider-aws version 1.9.0. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@bflad bflad added this to the v1.9.0 milestone Feb 9, 2018
@ewbankkit ewbankkit deleted the issue-2460 branch August 3, 2018 14:16
@ghost
Copy link

ghost commented Apr 4, 2020

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 Apr 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. new-resource Introduces a new resource. service/ec2 Issues and PRs that pertain to the ec2 service.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: Support AWS PrivateLink for AWS Services