Closed mtander closed 4 weeks ago
I figured out the syntax with some help. I'll leave this for posterity and close the bug.
(within service_config
section of resource google_cloudfunctions2_function
)
service_config {
max_instance_count = 3
min_instance_count = 1
available_memory = "256M"
timeout_seconds = 60
secret_environment_variables {
key = "DocumentOCRProjectId"
project_id = var.project
secret = "projects/${var.project}/secrets/DocumentOCRProjectId"
version = "latest"
}
secret_environment_variables {
key = "DocumentOCRSplitterProcessorId"
project_id = var.project
secret = "projects/${var.project}/secrets/DocumentOCRSplitterProcessorId"
version = "latest"
}
ingress_settings = "ALLOW_INTERNAL_ONLY"
all_traffic_on_latest_revision = true
service_account_email = google_service_account.cloud_function_account.email
}
Extension Version
v2.30.2
VS Code Version
Version: 1.89.1 (Universal) Commit: dc96b837cf6bb4af9cd736aa3af08cf8279f7685 Date: 2024-05-07T05:14:24.611Z Electron: 28.2.8 ElectronBuildId: 27744544 Chromium: 120.0.6099.291 Node.js: 18.18.2 V8: 12.0.267.19-electron.0 OS: Darwin arm64 23.4.0
Operating System
macOS Sonoma Version 14.4.1
Terraform Version
Terraform v1.8.5 on darwin_arm64 + provider registry.terraform.io/hashicorp/archive v2.4.2 + provider registry.terraform.io/hashicorp/google v5.32.0 + provider registry.terraform.io/hashicorp/random v3.6.2
Steps to Reproduce
View the following file
main.tf
in VSCodeSee highlighted error
An attribute named secret_environment_variables is not expected here
Expected Behavior
We should be able to pass in multiple blocks in the secret_environment_variables section without getting a syntax error from the extension. Additionally, the documentation should include an example of using more than one secret_environment_variable
Actual Behavior
Upon running
terraform plan
, I get the following message. I am not sure how to address this issue.│ Error: Unsupported argument │ │ on main.tf line 131, in resource "google_cloudfunctions2_function" "default": │ 131: secret_environment_variables = [ │ │ An argument named "secret_environment_variables" is not expected here. Did you mean to define a block of type "secret_environment_variables"?
Terraform Configuration
No response
Project Structure
No response
Gist
No response
Anything Else?
No response
Workarounds
No response
References
No response
Help Wanted
Community Note