An argument named "service_account" is not expected here.
Since upgrading my module from v0.5.0 to v0.6.0 I'm seeing this error.
│ Error: Unsupported argument
│
│ on .terraform/modules/pipeline.stream_producer_function/main.tf line 31, in resource "google_cloudfunctions2_function" "function":
│ 31: service_account = var.build_service_account
│
│ An argument named "service_account" is not expected here.
Here is my template code.
module "stream_producer_function" {
source = "GoogleCloudPlatform/cloud-functions/google"
project_id = var.project_id
function_name = "${local.full_app_name}-function"
function_location = var.region
runtime = "python312"
entrypoint = "main"
docker_repository = "projects/${var.project_id}/locations/us-central1/repositories/gcf-artifacts"
event_trigger = {
trigger_region = var.region
event_type = "google.cloud.pubsub.topic.v1.messagePublished"
service_account_email = null
pubsub_topic = google_pubsub_topic.producer_trigger_topic.id
retry_policy = var.retry_policy
event_filters = null
}
service_config = var.service_config
storage_source = {
bucket = var.bucket_name
object = google_storage_bucket_object.cf_source_zip_code_object.name
}
depends_on = [
google_storage_bucket_object.cf_source_zip_code_object
]
labels = var.labels
}
https://github.com/GoogleCloudPlatform/terraform-google-cloud-functions/commit/d17cfa7f14bbe31c2ddb6aa882a12a83cee4de56#diff-dc46acf24afd63ef8c556b77c126ccc6e578bc87e3aa09a931f33d9bf2532fbbR31
Facing the same issue!
module "cf_my-function" {
source = "GoogleCloudPlatform/cloud-functions/google"
version = "~> 0.6.0"
# Required variables
function_name = "my-function"
project_id = var.project_id
function_location = var.region
runtime = "python310"
entrypoint = "main"
storage_source = {
bucket = var.source_bucket
object = google_storage_bucket_object.code_bucket_obj.name
generation = null
}
service_config = {
service_account_email = module.sa.email
available_memory = "8G"
available_cpu = "2000m"
}
event_trigger = {
event_type = "google.cloud.storage.object.v1.finalized"
service_account_email = module.sa.email
retry_policy = "RETRY_POLICY_DO_NOT_RETRY"
trigger_region = var.region
event_filters = [
{
attribute = "bucket"
attribute_value = var.target_bucket
}
]
}
}
Works fine with 0.5.0
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days
I am also experiencing this bug. Can the issue be re-opened?
Can you check the configuration arguments? The source blocks should be enclosed within the build_config block which could be the reason.
build_config { . . storage_source = { bucket = var.bucket_name object = google_storage_bucket_object.cf_source_zip_code_object.name } }
Same issue here.