On GCP, I'm trying to run the Cloud Run service "renderer" with the Terraform code below and in this code, I concatenate "gcr.io/", the variable var.project_id and "/renderer:latest" using plus(+):
resource "google_cloud_run_service" "renderer" {
name = "renderer"
location = "asia-northeast1"
template {
spec {
containers {
image = "gcr.io/" + var.project_id + "/renderer:latest" // Here
}
service_account_name = google_service_account.renderer_identity.email
}
}
traffic {
percent = 100
latest_revision = true
}
}
Then, when I applied this code above, I got this error below:
Error: Invalid operand
on 2nd.tf line 38, in resource "google_cloud_run_service" "renderer":
38: image = "gcr.io/" + var.project_id + "/renderer:latest"
Unsuitable value for left operand: a number is required.
Error: Invalid operand
on 2nd.tf line 38, in resource "google_cloud_run_service" "renderer":
38: image = "gcr.io/" + var.project_id + "/renderer:latest"
Unsuitable value for right operand: a number is required.
Is it impossible to use plus(+) for concatenation? and if it's impossible, how do I do concatenation in Terraform?