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 support for api key source on api gateway #4717

Merged
merged 6 commits into from
Jun 4, 2018
Merged

Add support for api key source on api gateway #4717

merged 6 commits into from
Jun 4, 2018

Conversation

pablo-ruth
Copy link
Contributor

Fixes #4425

Changes proposed in this pull request:

  • Add support for API Key source in API Gateway

@ghost ghost added the size/XS Managed by automation to categorize the size of a PR. label May 31, 2018
@ghost ghost added size/S Managed by automation to categorize the size of a PR. and removed size/XS Managed by automation to categorize the size of a PR. labels May 31, 2018
@pablo-ruth
Copy link
Contributor Author

Acc Checks OK

==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./... -v -run=TestAccAWSAPIGatewayRestApi -timeout 120m
?       github.com/terraform-providers/terraform-provider-aws   [no test files]
=== RUN   TestAccAWSAPIGatewayRestApi_basic
--- PASS: TestAccAWSAPIGatewayRestApi_basic (75.50s)
=== RUN   TestAccAWSAPIGatewayRestApi_EndpointConfiguration
--- PASS: TestAccAWSAPIGatewayRestApi_EndpointConfiguration (86.75s)
=== RUN   TestAccAWSAPIGatewayRestApi_policy
--- PASS: TestAccAWSAPIGatewayRestApi_policy (75.17s)
=== RUN   TestAccAWSAPIGatewayRestApi_openapi
--- PASS: TestAccAWSAPIGatewayRestApi_openapi (58.33s)
PASS
ok      github.com/terraform-providers/terraform-provider-aws/aws       295.777s

@pablo-ruth pablo-ruth changed the title [WIP] add support for api key source on api gateway Add support for api key source on api gateway May 31, 2018
@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. service/apigateway Issues and PRs that pertain to the apigateway service. labels Jun 2, 2018
@bflad
Copy link
Contributor

bflad commented Jun 2, 2018

Hi @pablo-ruth 👋 Thanks so much for submitting this! I think you're right on track so far -- could you please take a look at:

  • Implementing the patch operation to update the value in resourceAwsApiGatewayRestApiUpdateOperations? Currently if you attempted to change the value of this attribute for an existing resource in Terraform it will continually show as needing to be updated but not be able do anything. The API Gateway API seems to support the replace operation for /apiKeySource according to https://docs.aws.amazon.com/apigateway/api-reference/link-relation/restapi-update/
  • Adding an acceptance test check for the value of api_key_source in TestAccAWSAPIGatewayRestApi_basic -- something like this should do it: resource.TestCheckResourceAttr("aws_api_gateway_rest_api.test", "api_key_source", "HEADER"),
  • Implementing a separate test case and configuration that tries setting the value to AUTHORIZER and updating it back to HEADER? Feel free to copy-paste something similar to the policy test and config should get you really close.
  • Documenting the new argument in website/docs/r/api_gateway_rest_api.html.markdown

Please let us know if you do not have time to implement these or have any questions - thanks again!

@bflad bflad added the waiting-response Maintainers are waiting on response from community or contributor. label Jun 2, 2018
@ghost ghost added size/M Managed by automation to categorize the size of a PR. and removed size/S Managed by automation to categorize the size of a PR. labels Jun 4, 2018
@pablo-ruth
Copy link
Contributor Author

Hi @bflad,

Thanks for your guidance. I implemented patch method, added acc test and doc. Acc tests pass.

==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./... -v -run=TestAccAWSAPIGatewayRestApi -timeout 120m
?       github.com/terraform-providers/terraform-provider-aws   [no test files]
=== RUN   TestAccAWSAPIGatewayRestApi_basic
--- PASS: TestAccAWSAPIGatewayRestApi_basic (62.29s)
=== RUN   TestAccAWSAPIGatewayRestApi_EndpointConfiguration
--- PASS: TestAccAWSAPIGatewayRestApi_EndpointConfiguration (68.81s)
=== RUN   TestAccAWSAPIGatewayRestApi_api_key_source
--- PASS: TestAccAWSAPIGatewayRestApi_api_key_source (65.33s)
=== RUN   TestAccAWSAPIGatewayRestApi_policy
--- PASS: TestAccAWSAPIGatewayRestApi_policy (57.70s)
=== RUN   TestAccAWSAPIGatewayRestApi_openapi
--- PASS: TestAccAWSAPIGatewayRestApi_openapi (46.05s)
PASS
ok      github.com/terraform-providers/terraform-provider-aws/aws       300.187s

@bflad bflad removed the waiting-response Maintainers are waiting on response from community or contributor. label Jun 4, 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.

Fantastic work, @pablo-ruth! Looks great. 🚀

make testacc TEST=./aws TESTARGS='-run=TestAccAWSAPIGatewayRestApi'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccAWSAPIGatewayRestApi -timeout 120m
=== RUN   TestAccAWSAPIGatewayRestApi_basic
--- PASS: TestAccAWSAPIGatewayRestApi_basic (27.09s)
=== RUN   TestAccAWSAPIGatewayRestApi_EndpointConfiguration
--- PASS: TestAccAWSAPIGatewayRestApi_EndpointConfiguration (62.25s)
=== RUN   TestAccAWSAPIGatewayRestApi_api_key_source
--- PASS: TestAccAWSAPIGatewayRestApi_api_key_source (28.75s)
=== RUN   TestAccAWSAPIGatewayRestApi_policy
--- PASS: TestAccAWSAPIGatewayRestApi_policy (32.84s)
=== RUN   TestAccAWSAPIGatewayRestApi_openapi
--- PASS: TestAccAWSAPIGatewayRestApi_openapi (29.09s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	180.073s

@bflad bflad added this to the v1.22.0 milestone Jun 4, 2018
@bflad bflad merged commit 7892a63 into hashicorp:master Jun 4, 2018
bflad added a commit that referenced this pull request Jun 4, 2018
@pablo-ruth pablo-ruth deleted the apikeysource branch June 4, 2018 14:56
@bflad
Copy link
Contributor

bflad commented Jun 5, 2018

This has been released in version 1.22.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 5, 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 5, 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/M Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] API Gateway: Support for API Keys in Custom Authorizer Responses
2 participants