I have created a cloud function which retrieve two .tf files form my bitbucket repo. Below is the snippet of function response:
curl -X POST "<myappurl>" \
-H "Authorization: Bearer $(gcloud auth print-identity-token)" \
-H "Content-Type: application/json" \
-d '{
"services": ["gcs_storage"]
}'
{"gcs_storage":{"outputs.tf":"# Output the self link of each bucket (useful for referencing in other resources)\noutput \"bucket_self_links\" {\n description = \"Map of bucket names to their self links.\"\n value = {\n for name, bucket in google_storage_bucket.buckets :\n name => bucket.self_link\n }\n}\n\n# Output the public URL of each bucket (useful for UI access or static hosting)\noutput \"bucket_urls\" {\n description = \"Map of bucket names to their public URLs.\"\n value = {\n for name, bucket in google_storage_bucket.buckets :\n name => \"https://storage.googleapis.com/${bucket.name}\"\n }\n}\n","variables.tf":"variable \"project_id\" {\n description = \"GCP project ID.\"\n type = string\n validation {\n condition = length(var.project_id) > 0\n error_message = \"Project ID must not be empty.\"\n }\n}\n\nvariable \"prefix\" {\n description = \"Prefix to apply to all bucket names.\"\n type = string\n default = \"\"\n validation {\n condition = var.prefix == \"\" || can(regex(\"^[a-z0-9-]+$\", var.prefix))\n error_message = \"Prefix must contain only lowercase letters, numbers, and dashes.\"\n }\n}\n\nvariable \"buckets\" {\n description = \"List of GCS bucket configurations.\"\n type = list(object({\n name = string\n location = string\n storage_class = string\n versioning = bool\n uniform_bucket_level_access = bool\n labels = optional(map(string), {}) # Optional labels values\n lifecycle_rules = optional(list(object({ # Optional lifecycle rules\n action = object({\n type = string\n storage_class = optional(string)\n })\n condition = object({\n age = optional(number)\n created_before = optional(string)\n with_state = optional(string)\n matches_storage_class = optional(list(string))\n num_newer_versions = optional(number)\n })\n })), [])\n }))\n\n validation {\n condition = alltrue([\n for b in var.buckets :\n (\n can(regex(\"^[a-z0-9._-]{3,63}$\", b.name)) &&\n contains([\"STANDARD\", \"NEARLINE\", \"COLDLINE\", \"ARCHIVE\"], b.storage_class)\n )\n ])\n error_message = \"Each bucket name must be 3-63 characters long and contain only lowercase letters, numbers, dashes, underscores, or dots. Storage class must be one of: STANDARD, NEARLINE, COLDLINE, ARCHIVE.\"\n }\n\n}\n"}}
........................................................
I have created a tool of OpenAPI type in conversational agent with the following yaml:
But I'm getting empty output. How can I fix it?
Hi @prabhatu012345,
Welcome to the Google Cloud Community!
You might find it helpful to check this case to address your issue. It offers a suggested approach to address the issue you encountered.
Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.