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

Feature Request: Support resource policy when creating AWS api gateway #4171

Closed
ben-poole opened this issue Apr 11, 2018 · 5 comments · Fixed by #4211
Closed

Feature Request: Support resource policy when creating AWS api gateway #4171

ben-poole opened this issue Apr 11, 2018 · 5 comments · Fixed by #4211
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/apigateway Issues and PRs that pertain to the apigateway service.
Milestone

Comments

@ben-poole
Copy link

Amazon API Gateway Supports Resource Policies for APIs: https://aws.amazon.com/about-aws/whats-new/2018/04/amazon-api-gateway-supports-resource-policies/

CLI: aws apigateway create-rest-api \ --name "api-name" \ --policy "{\"jsonEscapedPolicyDocument\"}"

Can this be supported in aws_api_gateway_rest_api?

Terraform Version

terraform 0.10+

Affected Resource(s)

aws_api_gateway_rest_api

Terraform Configuration Files

Current:

resource "aws_api_gateway_rest_api" "MyDemoAPI" {
  name        = "MyDemoAPI"
  description = "This is my API for demonstration purposes"
}

Proposed:

resource "aws_api_gateway_rest_api" "MyDemoAPI" {
  name        = "MyDemoAPI"
  description = "This is my API for demonstration purposes"
  policy = "{\"jsonEscapedPolicyDocument\"}"
}

References

@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 Apr 20, 2018
@bflad bflad added this to the v1.16.0 milestone Apr 20, 2018
@bflad
Copy link
Contributor

bflad commented Apr 20, 2018

Support for configuring aws_api_gateway_rest_api resource policy has been merged into master via #4211 and will release with v1.16.0 of the AWS provider, likely mid next week. 👍

@bflad
Copy link
Contributor

bflad commented Apr 25, 2018

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

@marcoreni
Copy link
Contributor

@bflad there seems to be an issue with the release.

After upgrading to 1.16.0 I'm getting error unescaping policy: invalid syntax error while running apply, even if I haven't declared a policy.

@bflad
Copy link
Contributor

bflad commented Apr 27, 2018

I would suggest opening a new issue filling out the template so we have details to troubleshoot. 👍 We'll likely need to see the debug logs from the SDK.

Admittedly the policy handling is a little strange to begin with:

https://github.com/terraform-providers/terraform-provider-aws/blob/6ef2184acfdf0ec330d5cfb35cf5ea7e51049fb2/aws/resource_aws_api_gateway_rest_api.go#L166-L172

@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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants