Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/deployment/gcloud/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
*.backup
*.tfstate

# Lock file not needed for examples.
.terraform.lock.hcl

# HCL vars except example
*.tfvars
!example.tfvars
Expand Down
36 changes: 0 additions & 36 deletions docs/deployment/gcloud/.terraform.lock.hcl

This file was deleted.

8 changes: 4 additions & 4 deletions docs/deployment/gcloud/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

## Prerequisites

* [OpenTofu](https://opentofu.org) or Terraform.
* [Terraform](https://www.terraform.io/) or [OpenTofu](https://opentofu.org).
* [gcloud](https://cloud.google.com/sdk/docs/install) tool.
* [Google Cloud](https://cloud.google.com/) project.

## Setup

* Initialize project using `tofu init` command.
* Initialize project using `terraform init` command.
* Copy `example.tfvars` to `prod.tfvars` and edit the file.
* Prepare Terraform plan using variables file: \
`tofu plan -var-file="prod.tfvars" -out=tfplan`
* Apply a plan using `tofu apply tfplan` command.
`terraform plan -var-file="prod.tfvars" -out=tfplan`
* Apply a plan using `terraform apply tfplan` command.
3 changes: 2 additions & 1 deletion docs/deployment/gcloud/main.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# See: https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/cloud_run_v2_service
# See: https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/cloud_run_v2_service

# Beta provider is required for "empty_dir" storage type.
provider "google-beta" {
Expand Down Expand Up @@ -109,6 +109,7 @@ resource "google_cloud_run_v2_service" "default" {
# Make service public.
# See: https://cloud.google.com/run/docs/authenticating/public
resource "google_cloud_run_service_iam_binding" "run_invoker" {
project = google_cloud_run_v2_service.default.project
location = google_cloud_run_v2_service.default.location
service = google_cloud_run_v2_service.default.name
role = "roles/run.invoker"
Expand Down
15 changes: 15 additions & 0 deletions docs/deployment/gcloud/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
terraform {
required_version = "~> 1.5"
Copy link

Choose a reason for hiding this comment

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

in the main you have defined one only provider google-betaand using it but then you bring in the second one and you do not define it in the main. either you define both and use both or pick one.


required_providers {
google-beta = {
source = "hashicorp/google-beta"
version = "~> 5.38"
}

google = {
source = "hashicorp/google"
version = "~> 5.38"
}
}
}