Skip to content

Commit

Permalink
feat: added traffic.tag (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
prabhu34 authored Dec 14, 2022
1 parent 882a663 commit 1644ac0
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ module "cloud_run" {
| template\_annotations | Annotations to the container metadata including VPC Connector and SQL. See [more details](https://cloud.google.com/run/docs/reference/rpc/google.cloud.run.v1#revisiontemplate) | `map(string)` | <pre>{<br> "autoscaling.knative.dev/maxScale": 2,<br> "autoscaling.knative.dev/minScale": 1,<br> "generated-by": "terraform",<br> "run.googleapis.com/client-name": "terraform"<br>}</pre> | no |
| template\_labels | A set of key/value label pairs to assign to the container metadata | `map(string)` | `{}` | no |
| timeout\_seconds | Timeout for each request | `number` | `120` | no |
| traffic\_split | Managing traffic routing to the service | <pre>list(object({<br> latest_revision = bool<br> percent = number<br> revision_name = string<br> }))</pre> | <pre>[<br> {<br> "latest_revision": true,<br> "percent": 100,<br> "revision_name": "v1-0-0"<br> }<br>]</pre> | no |
| traffic\_split | Managing traffic routing to the service | <pre>list(object({<br> latest_revision = bool<br> percent = number<br> revision_name = string<br> tag = string<br> }))</pre> | <pre>[<br> {<br> "latest_revision": true,<br> "percent": 100,<br> "revision_name": "v1-0-0",<br> "tag": null<br> }<br>]</pre> | no |
| verified\_domain\_name | List of Custom Domain Name | `list(string)` | `[]` | no |
| volume\_mounts | [Beta] Volume Mounts to be attached to the container (when using secret) | <pre>list(object({<br> mount_path = string<br> name = string<br> }))</pre> | `[]` | no |
| volumes | [Beta] Volumes needed for environment variables (when using secret) | <pre>list(object({<br> name = string<br> secret = set(object({<br> secret_name = string<br> items = map(string)<br> }))<br> }))</pre> | `[]` | no |
Expand Down
4 changes: 2 additions & 2 deletions examples/cloud_run_vpc_connector/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = "~> 4.0"
version = "< 5.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = "~> 4.0"
version = "< 5.0"
}
}
}
4 changes: 2 additions & 2 deletions examples/simple_cloud_run/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = "~> 3.53"
version = "< 5.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = "~> 3.53"
version = "< 5.0"
}
}
}
4 changes: 2 additions & 2 deletions examples/simple_cloud_run_with_cmek/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = "~> 4.0"
version = "< 5.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = "~> 4.0"
version = "< 5.0"
}
}
}
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ resource "google_cloud_run_service" "main" {
percent = lookup(traffic.value, "percent", 100)
latest_revision = lookup(traffic.value, "latest_revision", null)
revision_name = lookup(traffic.value, "latest_revision") ? null : lookup(traffic.value, "revision_name")
tag = lookup(traffic.value, "tag", null)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion modules/secure-cloud-run-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ module "cloud_run_core" {
| ssl\_certificates | A object with a list of domains to auto-generate SSL certificates or a list of SSL Certificates self-links in the pattern `projects/<PROJECT-ID>/global/sslCertificates/<CERT-NAME>` to be used by Load Balancer. | <pre>object({<br> ssl_certificates_self_links = list(string)<br> generate_certificates_for_domains = list(string)<br> })</pre> | n/a | yes |
| template\_labels | A set of key/value label pairs to assign to the container metadata. | `map(string)` | `{}` | no |
| timeout\_seconds | Timeout for each request. | `number` | `120` | no |
| traffic\_split | Managing traffic routing to the service. | <pre>list(object({<br> latest_revision = bool<br> percent = number<br> revision_name = string<br> }))</pre> | <pre>[<br> {<br> "latest_revision": true,<br> "percent": 100,<br> "revision_name": "v1-0-0"<br> }<br>]</pre> | no |
| traffic\_split | Managing traffic routing to the service. | <pre>list(object({<br> latest_revision = bool<br> percent = number<br> revision_name = string<br> tag = string<br> }))</pre> | <pre>[<br> {<br> "latest_revision": true,<br> "percent": 100,<br> "revision_name": "v1-0-0",<br> "tag": "dedicatedurl"<br> }<br>]</pre> | no |
| verified\_domain\_name | List of custom Domain Name. | `list(string)` | n/a | yes |
| volume\_mounts | [Beta] Volume Mounts to be attached to the container (when using secret). | <pre>list(object({<br> mount_path = string<br> name = string<br> }))</pre> | `[]` | no |
| volumes | [Beta] Volumes needed for environment variables (when using secret). | <pre>list(object({<br> name = string<br> secret = set(object({<br> secret_name = string<br> items = map(string)<br> }))<br> }))</pre> | `[]` | no |
Expand Down
2 changes: 2 additions & 0 deletions modules/secure-cloud-run-core/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,13 @@ variable "traffic_split" {
latest_revision = bool
percent = number
revision_name = string
tag = string
}))
default = [{
latest_revision = true
percent = 100
revision_name = "v1-0-0"
tag = "dedicatedurl"
}]
}

Expand Down
2 changes: 2 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@ variable "traffic_split" {
latest_revision = bool
percent = number
revision_name = string
tag = string
}))
description = "Managing traffic routing to the service"
default = [{
latest_revision = true
percent = 100
revision_name = "v1-0-0"
tag = null
}]
}

Expand Down
4 changes: 2 additions & 2 deletions versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 3.53, < 5.0"
version = "< 5.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 3.53, < 5.0"
version = "< 5.0"
}
}

Expand Down

0 comments on commit 1644ac0

Please sign in to comment.