FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit 175c5f45 authored by Dr Rich Wareham's avatar Dr Rich Wareham
Browse files

fix idempotent behaviour of allow_ingress [REVIEW]

It would appear that the "run.googleapis.com/ingress" annotation can be
set to "all" without having to enable the beta launch stage. Indeed it
*has* to be set to "all" since attempting to unset it causes Cloud Run
to immediately reset it.
parent b8163a9d
No related branches found
No related tags found
1 merge request!13allow ingress type to be specified
Pipeline #56941 passed
...@@ -37,15 +37,16 @@ resource "google_cloud_run_service" "webapp" { ...@@ -37,15 +37,16 @@ resource "google_cloud_run_service" "webapp" {
"run.googleapis.com/ingress-status" : "placeholder", "run.googleapis.com/ingress-status" : "placeholder",
}, },
var.allowed_ingress != "" ? ( # Add the beta launch stage if required.
{ var.allowed_ingress != "all" ? {
# Required to be able to set ingress type. # Required to be able to set ingress type.
"run.googleapis.com/launch-stage" : "BETA", "run.googleapis.com/launch-stage" : "BETA",
} : {},
# Specify the allowable ingress types. # Specify the allowable ingress types.
"run.googleapis.com/ingress" : var.allowed_ingress, {
} "run.googleapis.com/ingress" : var.allowed_ingress,
) : {}, },
var.service_annotations, var.service_annotations,
) )
......
...@@ -124,13 +124,13 @@ variable "monitoring_path" { ...@@ -124,13 +124,13 @@ variable "monitoring_path" {
} }
variable "allowed_ingress" { variable "allowed_ingress" {
default = "" default = "all"
description = <<EOL description = <<EOL
Specify the allowed ingress to the service. Should be one of: Specify the allowed ingress to the service. Should be one of:
"", "all", "internal" or "internal-and-cloud-load-balancing". "all", "internal" or "internal-and-cloud-load-balancing".
Setting this to a non-empty value implies that the service will be moved to Setting this to a value other than "all" implies that the service will be
the "beta" launch stage. See moved to the "beta" launch stage. See
https://cloud.google.com/run/docs/troubleshooting#launch-stage-validation. https://cloud.google.com/run/docs/troubleshooting#launch-stage-validation.
EOL EOL
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment