Fix gcs mounts for cloud-run-v2, closes #2684

This commit is contained in:
Wiktor Niesiobędzki
2024-11-14 09:56:06 +00:00
committed by Wiktor Niesiobędzki
parent 2b378f4b3a
commit fe52a9102b
3 changed files with 75 additions and 6 deletions

View File

@@ -5,6 +5,7 @@ Cloud Run Services and Jobs, with support for IAM roles and Eventarc trigger cre
<!-- BEGIN TOC -->
- [IAM and environment variables](#iam-and-environment-variables)
- [Mounting secrets as volumes](#mounting-secrets-as-volumes)
- [Mounting GCS buckets](#mounting-gcs-buckets)
- [Connecting to Cloud SQL database](#connecting-to-cloud-sql-database)
- [Beta features](#beta-features)
- [VPC Access Connector](#vpc-access-connector)
@@ -84,6 +85,34 @@ module "cloud_run" {
# tftest modules=2 resources=4 fixtures=fixtures/secret-credentials.tf inventory=service-volume-secretes.yaml e2e
```
## Mounting GCS buckets
```hcl
module "cloud_run" {
source = "./fabric/modules/cloud-run-v2"
project_id = var.project_id
name = "hello"
region = var.region
containers = {
hello = {
image = "us-docker.pkg.dev/cloudrun/container/hello"
volume_mounts = {
bucket = "/bucket"
}
}
}
volumes = {
bucket = {
gcs = {
bucket = var.bucket
is_read_only = false
}
}
}
}
# tftest inventory=gcs-mount.yaml e2e
```
## Connecting to Cloud SQL database
```hcl