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

r/api_gateway_rest_api_policy - add new resource #13619

Merged
merged 9 commits into from
Nov 17, 2020

Conversation

DrFaust92
Copy link
Collaborator

@DrFaust92 DrFaust92 commented Jun 4, 2020

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" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Closes #5834
Relates #5549
Relates #10986

Release note for CHANGELOG:

resource_aws_api_gateway_rest_api_policy: new resource

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAWSAPIGatewayRestApiPolicy_'
--- PASS: TestAccAWSAPIGatewayRestApiPolicy_basic (165.57s)
--- PASS: TestAccAWSAPIGatewayRestApiPolicy_disappears (68.53s)
--- PASS: TestAccAWSAPIGatewayRestApiPolicy_disappears_restApi (80.66s)

@DrFaust92 DrFaust92 requested a review from a team June 4, 2020 20:23
@ghost ghost added size/XL Managed by automation to categorize the size of a PR. provider Pertains to the provider itself, rather than any interaction with AWS. service/apigateway Issues and PRs that pertain to the apigateway service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. documentation Introduces or discusses updates to documentation. labels Jun 4, 2020
@DrFaust92 DrFaust92 changed the title [WIP]r/api_gateway_rest_api_policy - add new resource r/api_gateway_rest_api_policy - add new resource Jun 4, 2020
@DrFaust92 DrFaust92 force-pushed the r/api_gateway_rest_api_policy branch from 3b29885 to 8a9392d Compare June 27, 2020 09:00
@ultrafez
Copy link

Thank you for raising this PR! I've been experiencing #5549, so I'm grateful for you taking the time to work on a fix.

Apparently there are conflicts on website/aws.erb, does this branch need rebasing before it can be reviewed/merged?

@DrFaust92 DrFaust92 force-pushed the r/api_gateway_rest_api_policy branch from a56aadd to c243d96 Compare August 24, 2020 12:27
@DrFaust92
Copy link
Collaborator Author

Rebased and refactored

@slikk66
Copy link

slikk66 commented Sep 1, 2020

how long does this usually take to merge an all green PR ?

@bflad bflad self-assigned this Nov 17, 2020
@bflad bflad added the new-resource Introduces a new resource. label Nov 17, 2020
@bflad bflad added this to the v3.16.0 milestone Nov 17, 2020
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, @DrFaust92 🚀

Output from acceptance testing (see other comment for failure details):

--- PASS: TestAccAWSAPIGatewayRestApiPolicy_disappears_restApi (16.41s)
--- PASS: TestAccAWSAPIGatewayRestApi_openapi (45.41s)
--- PASS: TestAccAWSAPIGatewayRestApi_basic (74.27s)
--- PASS: TestAccAWSAPIGatewayRestApi_api_key_source (106.42s)
--- PASS: TestAccAWSAPIGatewayRestApi_EndpointConfiguration_Private (113.88s)
--- PASS: TestAccAWSAPIGatewayRestApiPolicy_disappears (141.26s)
--- PASS: TestAccAWSAPIGatewayRestApi_tags (168.51s)
--- FAIL: TestAccAWSAPIGatewayRestApi_policy (199.92s)
--- PASS: TestAccAWSAPIGatewayRestApi_EndpointConfiguration (268.79s)
--- PASS: TestAccAWSAPIGatewayRestApi_disappears (385.07s)
--- PASS: TestAccAWSAPIGatewayRestApi_EndpointConfiguration_VPCEndpoint (386.16s)
--- PASS: TestAccAWSAPIGatewayRestApiPolicy_basic (428.07s)

@@ -49,6 +49,7 @@ func resourceAwsApiGatewayRestApi() *schema.Resource {
"policy": {
Type: schema.TypeString,
Optional: true,
Computed: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

This update breaks the existing TestAccAWSAPIGatewayRestApi_policy test:

=== CONT  TestAccAWSAPIGatewayRestApi_policy
TestAccAWSAPIGatewayRestApi_policy: resource_aws_api_gateway_rest_api_test.go:446: Step 4/4 error: Check failed: Check 1/1 error: aws_api_gateway_rest_api.test: Attribute 'policy' expected "", got "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Deny\",\"Principal\":{\"AWS\":\"*\"},\"Action\":\"execute-api:Invoke\",\"Resource\":\"*\"}]}"
--- FAIL: TestAccAWSAPIGatewayRestApi_policy (199.92s)

Since the removal behavior is expected unless it is configured to an empty string (""), will update the test and document the behavior in the resource documentation on merge.

@bflad bflad merged commit f2904b2 into hashicorp:master Nov 17, 2020
@slikk66
Copy link

slikk66 commented Nov 17, 2020

how long does this usually take to merge an all green PR ?

apparently 76 days :p

bflad added a commit that referenced this pull request Nov 17, 2020
bflad added a commit that referenced this pull request Nov 17, 2020
@ghost
Copy link

ghost commented Nov 18, 2020

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

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Dec 18, 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 as resolved and limited conversation to collaborators Dec 18, 2020
@DrFaust92 DrFaust92 deleted the r/api_gateway_rest_api_policy branch April 15, 2021 10:48
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. new-resource Introduces a new resource. provider Pertains to the provider itself, rather than any interaction with AWS. service/apigateway Issues and PRs that pertain to the apigateway service. size/XL 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.

Separate resource for gateway_rest_api resource policy
4 participants