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 API Gateway Resources #7212

Closed
upodroid opened this issue Sep 8, 2020 · 8 comments · Fixed by GoogleCloudPlatform/magic-modules#4066, hashicorp/terraform-provider-google-beta#2636 or #7626
Labels
Milestone

Comments

@upodroid
Copy link
Contributor

upodroid commented Sep 8, 2020

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment. If the issue is assigned to the "modular-magician" user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If the issue is assigned to a user, that user is claiming responsibility for the issue. If the issue is assigned to "hashibot", a community member has claimed the issue already.

Description

Google released the API Gateway.

https://cloud.google.com/blog/products/serverless/google-cloud-api-gateway-is-now-available-in-public-beta
https://cloud.google.com/api-gateway/docs/reference/rest/v1beta/projects.locations.gateways

New or Affected Resource(s)

  • google_api_gateway_api
  • google_api_gateway_config
  • google_api_gateway_gateway

Potential Terraform Configuration

# Propose what you think the configuration to take advantage of this feature should look like.
# We may not use it verbatim, but it's helpful in understanding your intent.

References

  • #0000
@trevoro
Copy link

trevoro commented Oct 8, 2020

Most of the commands to manipulate the cloud gateway seem fairly straightforward. The resources are easy to reference and are unique. The challenge / design decision seems to be mostly based around how to handle the openapi specification yaml file. Is that something that would be embedded into a terraform config / module or would it simply be referenced and edited along side .tf files?

@dinvlad
Copy link

dinvlad commented Oct 8, 2020

I'd suggest keeping it simple in the beginning, using a regular string field, like so:

openapi_documents = [yamlencode({
  swagger = "2.0"
  …
})]

This is similar to how it can be done, for example, through the body argument of aws_apigatewayv2_api.
Then if there's need for a dedicated data source, we could add it later without changing this feature.

@upodroid
Copy link
Contributor Author

upodroid commented Oct 8, 2020

I'm thinking of having a yaml template that terraform dynamically generates at plan/apply time. As you see in the tutorials you need to supply urls of functions and cloud run services. Maybe some service account emails too.

https://www.terraform.io/docs/configuration/functions/templatefile.html

@dinvlad
Copy link

dinvlad commented Oct 8, 2020

For sure, and the above syntax (yamlencode) supports that too.

@trevoro
Copy link

trevoro commented Oct 9, 2020

OK so I dug into what it takes to write these. There's a generator written in ruby that probably needs to be used. It would take me awhile to wrap my head around how that works. I'd appreciate some guidance from the team on the best example resource that's similar to this so I can get an example before digging in. FWIW it's fairly impressive.

@wvanderdeijl
Copy link

wvanderdeijl commented Oct 18, 2020

You could also have a look at https://github.com/GoogleCloudPlatform/magic-modules/tree/master/products/servicemanagement which is the config for Google Cloud Endpoints which is a very similar product to the new API Gateway product

@upodroid
Copy link
Contributor Author

upodroid commented Oct 18, 2020

FYI: I already wrote a PR for this. It is the linked issue that will close this issue.

@ghost
Copy link

ghost commented Nov 23, 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. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Nov 23, 2020
@github-actions github-actions bot added service/apigateway forward/review In review; remove label to forward labels Jan 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.