我是 Terraform 新手,但我做了很多研究但找不到答案。我使用简单的 Terraform 文件创建 Cloud Run 实例没有问题。我可以毫无问题地设置环境变量和秘密。但是,我不知道如何创建其他设置,例如“内存分配”、“CPU 分配”等。
我的 terraform 文件如下所示:
resource "google_cloud_run_service" "myproject" {
project ="myproject"
name = "cloud-run-name"
location = "us-east1"
template {
spec {
containers {
image = "gcr.io/myproject/image"
env {
name = "VARIABLE1"
value = "variable1"
}
env {
name = "VARIABLE2"
value = "variable1"
}
}
}
}
traffic {
percent = 100
latest_revision = true
}
}
Run Code Online (Sandbox Code Playgroud)