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

provider/aws: add response parameters support to api gateway #6344

Conversation

joshrtay
Copy link
Contributor

No description provided.

@pieterjanpintens
Copy link

Would it be hard to also add selection_pattern to the AWS API calls?
For some reason this field can be defined but appears to be missing in the api calls.

@radeksimko
Copy link
Member

radeksimko commented Apr 26, 2016

Selection pattern is being fixed in #5893

Your PR is looking pretty good, just few questions:

  • would you mind adding at least one extra test case to the existing one that would be testing update of this new field (ideally adding a parameter and removing one)?
  • would you mind adding this field into docs for each resource?
  • would you mind keeping the // TODO comment there with a suggestion to reimplement this field after mentioned issue is resolved?

Thanks


There's also field called request_parameters in aws_api_gateway_integration and aws_api_gateway_method which could be implemented the same way (i.e. request_parameters_in_json), but if you think it's out of scope for this PR, that's totally 👌 .

@radeksimko
Copy link
Member

radeksimko commented Apr 26, 2016

Actually one more thing:

It looks like you're not reading the field back from the API in resourceAwsApiGatewayIntegrationResponseRead and resourceAwsApiGatewayMethodResponseRead. In case something/someone changes these fields outside of Terraform, then the plan would be inaccurate.

@radeksimko radeksimko added the waiting-response An issue/pull request is waiting for a response from the community label Apr 26, 2016
@joshrtay
Copy link
Contributor Author

Yep. No problem.

Thought about implementing request_parameters_in_json, but it isn't as high a priority for me, so I didn't :). I'll include it.

@joshrtay
Copy link
Contributor Author

@radeksimko It seems like you aren't reading any of the fields back for an IntegrationResponse. It also has SelectionPattern, and ResponseTemplate. Should ResponseTemplate be added in another pull request?

@radeksimko radeksimko removed the waiting-response An issue/pull request is waiting for a response from the community label Apr 27, 2016
@radeksimko
Copy link
Member

@joshrtay

It also has SelectionPattern, and ResponseTemplate

That's being fixed in https://github.com/hashicorp/terraform/pull/5893/files#diff-cdecbad1f1f7f16f3375b30f7e44e844R109 already

@radeksimko radeksimko added the waiting-response An issue/pull request is waiting for a response from the community label Apr 27, 2016
@joshrtay
Copy link
Contributor Author

@radeksimko bailed on request_parameters_in_json for the time being, but I've implemented the rest. AWS's updateMethodResponse API is pretty insane. is there a reason updates dont just use putMethodResponse?

@radeksimko radeksimko self-assigned this Apr 29, 2016
@radeksimko radeksimko removed the waiting-response An issue/pull request is waiting for a response from the community label May 3, 2016
@radeksimko
Copy link
Member

This now LGTM, thank you! 👍


is there a reason updates dont just use putMethodResponse?

Update via PATCH methods is more efficient as we only need to send fields that are going to be PATCHed, not all of them. It may sound like a small benefit, but if you think about that benefit in scale (more API Gateway Method Responses to update in one scope), it (IMO) makes sense.

Also if someone deletes the resource and Update is basically UPSERT (update or insert/create) - that's what Put* operations mean, then the fact that someone has deleted the resource is completely hidden from the user. If Update only updates existing resource and the resource is gone, then it will fail as expected.

Most of the time it actually won't fail because we wipe such resources during refresh (effectively Read for each resource) which is triggered by default before each plan/apply/destroy command, but it will at least appear in the log as WARN.

@radeksimko radeksimko merged commit 983da21 into hashicorp:master May 4, 2016
bigkraig pushed a commit to ticketmaster/terraform that referenced this pull request May 5, 2016
…rp#6344)

* provider/aws: Add support for response parameters aws_api_gateway_integration_response and aws_api_gateway_method response.

* fix spacing

* fix spacing

* gofmt

* add update test; add docs; add reimplement TODO; add field read

* resolve conflict

* fix expandAPIGatewayMethodResponse error handling
bigkraig pushed a commit to ticketmaster/terraform that referenced this pull request May 5, 2016
…rp#6344)

* provider/aws: Add support for response parameters aws_api_gateway_integration_response and aws_api_gateway_method response.

* fix spacing

* fix spacing

* gofmt

* add update test; add docs; add reimplement TODO; add field read

* resolve conflict

* fix expandAPIGatewayMethodResponse error handling
xsellier pushed a commit to xsellier/terraform that referenced this pull request May 17, 2016
…rp#6344)

* provider/aws: Add support for response parameters aws_api_gateway_integration_response and aws_api_gateway_method response.

* fix spacing

* fix spacing

* gofmt

* add update test; add docs; add reimplement TODO; add field read

* resolve conflict

* fix expandAPIGatewayMethodResponse error handling
cristicalin pushed a commit to cristicalin/terraform that referenced this pull request May 24, 2016
…rp#6344)

* provider/aws: Add support for response parameters aws_api_gateway_integration_response and aws_api_gateway_method response.

* fix spacing

* fix spacing

* gofmt

* add update test; add docs; add reimplement TODO; add field read

* resolve conflict

* fix expandAPIGatewayMethodResponse error handling
@ghost
Copy link

ghost commented Apr 26, 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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants