Skip to content

Commit

Permalink
fix: Resource readiness deadline exceeded error in secure-cloud-run (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
amandakarina authored Mar 10, 2023
1 parent 308beaf commit 541ed8d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
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> 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 |
| 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)` | 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: 1 addition & 1 deletion modules/secure-cloud-run-core/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ variable "traffic_split" {
latest_revision = true
percent = 100
revision_name = "v1-0-0"
tag = "dedicatedurl"
tag = null
}]
}

Expand Down
9 changes: 8 additions & 1 deletion modules/secure-cloud-run/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ module "cloud_run_security" {
]
}

resource "google_project_iam_member" "serverless_service_agent" {
project = var.serverless_project_id
role = "roles/run.serviceAgent"
member = "serviceAccount:${google_project_service_identity.serverless_sa.email}"
}

module "cloud_run_core" {
source = "../secure-cloud-run-core"

Expand All @@ -141,6 +147,7 @@ module "cloud_run_core" {
depends_on = [
module.serverless_project_apis,
google_artifact_registry_repository_iam_member.artifact_registry_iam,
google_service_account_iam_member.identity_service_account_user
google_service_account_iam_member.identity_service_account_user,
google_project_iam_member.serverless_service_agent
]
}

0 comments on commit 541ed8d

Please sign in to comment.