modular-magician user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to hashibot, a community member has claimed the issue already.Terraform v0.12.24
resource "google_pubsub_topic" "start_instance_event" {
project = var.project
name = "start-instance-event"
labels = {
service = "pubsub"
topic = "start-instance-event"
}
}
resource "google_storage_bucket" "cloudfunctions_fetcher_env" {
name = "cloudfunction-${var.project}"
location = var.region
project = var.project
storage_class = "REGIONAL"
}
data "archive_file" "startInstancePubSub" {
type = "zip"
output_path = "${path.module}/files/startInstancePubSub.zip"
source {
content = "${file("${path.module}/files/startInstancePubSub/index.js")}"
filename = "index.js"
}
source {
content = "${file("${path.module}/files/startInstancePubSub/package.json")}"
filename = "package.json"
}
}
resource "google_cloudfunctions_function" "startInstancePubSub" {
name = "startInstancePubSub"
runtime = "nodejs8"
entry_point = "startInstancePubSub"
available_memory_mb = 256
timeout = 60
project = var.project
region = var.region
ingress_settings = "ALLOW_INTERNAL_ONLY"
source_archive_bucket = google_storage_bucket.cloudfunctions_fetcher_env.name
source_archive_object = google_storage_bucket_object.startInstancePubSub.name
event_trigger {
event_type = "google.pubsub.topic.publish"
resource = google_pubsub_topic.start_instance_event.name
}
labels = {
deployment_name = "startInstancePubSub"
}
}
{
"error": {
"code": 400,
"message": "The request has errors",
"errors": [
G] plugin.terraform-provider-google_v3.17.0_x5: {
"message": "The request has errors",
"domain": "global",
"reason": "badRequest"
}
],
"status": "INVALID_ARGUMENT"
}
}
I try to deploy cloud function by terraform with use trigger PubSub, but it fails.
export TF_LOG=DEBUGterraform initterraform plan - this OKterraform apply - this fail@SergeSpinoza i don't see which resource was failing from your debug log. Can you provide the full debug log to get a better idea?
Hi! @venkykuberan https://pastebin.com/raw/R3RmY6Aj
@SergeSpinoza our internal log shows format errors for labels block, API accepts only lower case values for labels { key : value}. I will create an issue for our doc update.
changing your labels to lower case should fix the issue.
I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!
Most helpful comment
@SergeSpinoza our internal log shows format errors for labels block, API accepts only lower case values for
labels { key : value}. I will create an issue for our doc update.changing your labels to lower case should fix the issue.