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

resource/api_gateway_integration: support vpc link #3428

Merged

Conversation

loivis
Copy link
Contributor

@loivis loivis commented Feb 17, 2018

Follow up on #2512 to enable vpc link support for resource aws_api_gateway_integration

@ghost ghost added the size/L Managed by automation to categorize the size of a PR. label Feb 17, 2018
@loivis
Copy link
Contributor Author

loivis commented Feb 17, 2018

⎇  make testacc TEST=./aws TESTARGS='-run=TestAccAWSAPIGatewayIntegration_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccAWSAPIGatewayIntegration_ -timeout 120m
=== RUN   TestAccAWSAPIGatewayIntegration_basic
--- PASS: TestAccAWSAPIGatewayIntegration_basic (73.78s)
=== RUN   TestAccAWSAPIGatewayIntegration_contentHandling
--- PASS: TestAccAWSAPIGatewayIntegration_contentHandling (45.96s)
=== RUN   TestAccAWSAPIGatewayIntegration_cache_key_parameters
--- PASS: TestAccAWSAPIGatewayIntegration_cache_key_parameters (19.35s)
=== RUN   TestAccAWSAPIGatewayIntegration_vpcLink
--- PASS: TestAccAWSAPIGatewayIntegration_vpcLink (564.25s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	703.385s

@radeksimko radeksimko added enhancement Requests to existing resources that expand the functionality or scope. service/apigateway Issues and PRs that pertain to the apigateway service. labels Feb 19, 2018
@AlexCousens
Copy link

Would love to have this ASAP!

@gazmania-mccarthyfinch
Copy link

Can we get this merged and relaeased ASAP please? The previous vpc_link resource is great but it's useless without the integration piece.

@saxonww
Copy link

saxonww commented Feb 28, 2018 via email

@gazmania-mccarthyfinch
Copy link

gazmania-mccarthyfinch commented Feb 28, 2018

I'd like to move away from integrations aswell as they are pretty cumbersome, but AFAIK swagger import only supports Swagger2 and not the new OAS3 which all of our stuff is defined in. i guess that will come eventually.

@saxonww
Copy link

saxonww commented Feb 28, 2018 via email

@atrakic
Copy link

atrakic commented Mar 10, 2018

Would like to see this PR merged soon. Thx

@loivis loivis force-pushed the resource-api-gateway-integration-type-vpc-link branch from 07273ef to 995c78e Compare March 15, 2018 16:05
@ghost ghost added the size/L Managed by automation to categorize the size of a PR. label Mar 15, 2018
@loivis loivis force-pushed the resource-api-gateway-integration-type-vpc-link branch from 995c78e to 7382e36 Compare March 15, 2018 16:08
@ghost ghost added the size/L Managed by automation to categorize the size of a PR. label Mar 15, 2018
@loivis loivis force-pushed the resource-api-gateway-integration-type-vpc-link branch from 7382e36 to d06948c Compare March 15, 2018 16:10
@ghost ghost added the size/L Managed by automation to categorize the size of a PR. label Mar 15, 2018
@loivis
Copy link
Contributor Author

loivis commented Mar 15, 2018

resolve conflicts with master.

@loivis loivis force-pushed the resource-api-gateway-integration-type-vpc-link branch from d06948c to 05a41d2 Compare March 19, 2018 12:03
@ghost ghost added the size/L Managed by automation to categorize the size of a PR. label Mar 19, 2018
@loivis
Copy link
Contributor Author

loivis commented Mar 19, 2018

Some attention on this feature?

@grahamlyons
Copy link

Without wanting to be that guy who just +1s it, I'd like to see this feature in soon too.

@bamdadd
Copy link

bamdadd commented Apr 5, 2018

Any chance that this will get merged?

Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Thanks so much for this! Can you please add the two missing d.Set()? Then hopefully this is ready to ship. 🚀

var connectionId *string
if *connectionType == apigateway.ConnectionTypeVpcLink {
if _, ok := d.GetOk("connection_id"); !ok {
return fmt.Errorf("connection_id required when connection_type set to VPC_LINK")
Copy link
Contributor

Choose a reason for hiding this comment

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

We can move this to a CustomizeDiff for plan time validation at some point 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried but didn't manage to do it because of question hashicorp/terraform#17595

@@ -55,6 +55,21 @@ func resourceAwsApiGatewayIntegration() *schema.Resource {
}, false),
},

"connection_type": {
Copy link
Contributor

Choose a reason for hiding this comment

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

We're missing d.Set("connection_type", integration.ConnectionType) in the read function 😄

}, false),
},

"connection_id": {
Copy link
Contributor

Choose a reason for hiding this comment

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

We're missing d.Set("connection_id", integration.ConnectionId) in the read function 😄

@bflad bflad self-assigned this Apr 5, 2018
@bflad bflad added the waiting-response Maintainers are waiting on response from community or contributor. label Apr 5, 2018
@ghost ghost added the size/L Managed by automation to categorize the size of a PR. label Apr 6, 2018
@bflad bflad removed the waiting-response Maintainers are waiting on response from community or contributor. label Apr 6, 2018
@loivis
Copy link
Contributor Author

loivis commented Apr 6, 2018

just realized update is not handled at all 😱

@loivis loivis force-pushed the resource-api-gateway-integration-type-vpc-link branch from bc1423e to b146a80 Compare April 6, 2018 12:19
@ghost ghost added the size/L Managed by automation to categorize the size of a PR. label Apr 6, 2018
@loivis
Copy link
Contributor Author

loivis commented Apr 6, 2018

⎇  make fmt; and echo > aws/debug.log ; and make testacc TEST=./aws TESTARGS='-run=TestAccAWSAPIGatewayIntegration_integrationType'
gofmt -w $(find . -name '*.go' |grep -v vendor)
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccAWSAPIGatewayIntegration_integrationType -timeout 120m
=== RUN   TestAccAWSAPIGatewayIntegration_integrationType
--- PASS: TestAccAWSAPIGatewayIntegration_integrationType (701.09s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	701.128s

@bamdadd
Copy link

bamdadd commented Apr 11, 2018

Thanks for working on this. We also really need this functionality.

@bflad bflad added this to the v1.15.0 milestone Apr 11, 2018
@@ -240,6 +269,8 @@ func resourceAwsApiGatewayIntegrationRead(d *schema.ResourceData, meta interface
d.Set("request_parameters", aws.StringValueMap(integration.RequestParameters))
d.Set("request_parameters_in_json", aws.StringValueMap(integration.RequestParameters))
d.Set("passthrough_behavior", integration.PassthroughBehavior)
d.Set("connection_type", integration.ConnectionType)
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this might not always be returned? Maybe we should set it to INTERNET if nil

--- FAIL: TestAccAWSAPIGatewayIntegrationResponse_basic (110.48s)
    testing.go:518: Step 0 error: After applying this step, the plan was not empty:
        
        DIFF:
        
        UPDATE: aws_api_gateway_integration.test
          connection_type: "" => "INTERNET"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated but a bit curious though.
I think I covered the attribute check in TestAccAWSAPIGatewayIntegration_integrationType. Is "not always" behavior caused by regional difference from aws api? If so, it looks tricky to discover.

Copy link
Contributor

Choose a reason for hiding this comment

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

Not really sure, honestly. It seems some service APIs always return everything and others don't. 🙁

@loivis loivis force-pushed the resource-api-gateway-integration-type-vpc-link branch from 727d04d to 54c6734 Compare April 12, 2018 07:17
@ghost ghost added the size/L Managed by automation to categorize the size of a PR. label Apr 12, 2018
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Thanks so much for this @loivis!! 🚀

5 tests passed (all tests)
=== RUN   TestAccAWSAPIGatewayIntegration_cache_key_parameters
--- PASS: TestAccAWSAPIGatewayIntegration_cache_key_parameters (7.02s)
=== RUN   TestAccAWSAPIGatewayIntegration_basic
--- PASS: TestAccAWSAPIGatewayIntegration_basic (38.42s)
=== RUN   TestAccAWSAPIGatewayIntegrationResponse_basic
--- PASS: TestAccAWSAPIGatewayIntegrationResponse_basic (96.08s)
=== RUN   TestAccAWSAPIGatewayIntegration_contentHandling
--- PASS: TestAccAWSAPIGatewayIntegration_contentHandling (124.82s)
=== RUN   TestAccAWSAPIGatewayIntegration_integrationType
--- PASS: TestAccAWSAPIGatewayIntegration_integrationType (644.46s)

@bflad bflad merged commit 1dc66af into hashicorp:master Apr 12, 2018
bflad added a commit that referenced this pull request Apr 12, 2018
@bflad
Copy link
Contributor

bflad commented Apr 18, 2018

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

@ghost
Copy link

ghost commented Apr 6, 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 6, 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. service/apigateway Issues and PRs that pertain to the apigateway service. size/L Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants