hashicorp / terraform

Terraform enables you to safely and predictably create, change, and improve infrastructure. It is a source-available tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.
https://www.terraform.io/
Other
42.71k stars 9.55k forks source link

Tutorial or guide for enabling endpoints on google cloud run #25046

Closed danielhstahl closed 4 years ago

danielhstahl commented 4 years ago

Current Terraform Version

Terraform v0.12.25

Use-cases

I'm using GCP, and have been following this guide: https://cloud.google.com/endpoints/docs/openapi/get-started-cloud-run#endpoints_configure to deploy to proxy/authenticate requests to my cloud run application.

Obviously, I would prefer this to use terraform. However, I'm stuck attempting to pass the google endpoints service output into the gateway Dockerfile. Current workflow in gh actions is:

I can do the first two steps in terraform, but I'm not sure how to build the image unless I use two separate terraform specs.

Attempted Solutions

I've successfully implemented this using CLI commands in GH actions. https://github.com/realoptions/option_price_faas/blob/master/.github/workflows/release.yml

I've started trying to implement terraform as well: https://github.com/realoptions/option_price_faas/blob/feature/add_terraform/terraform/project.tf

Proposal

It may be possible to already do this, but I'm having trouble putting the pieces together. A guide may be useful. I've seen guides for endpoints and guides for cloud run, but not the two of them together.

References

https://github.com/hashicorp/terraform/issues/16606

danielhstahl commented 4 years ago

Seems like I missed an issue: https://github.com/terraform-providers/terraform-provider-google/issues/5528

I'll close in favor of 5528.

ghost commented 4 years ago

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.