I am trying to provision a version 2 cloud function using terraform in gcp. The resource looks like this:
resource "google_cloudfunctions2_function" "function" {
provider = google-beta
name = "test-function"
location = "us-central1"
description = "a new function"
When I run plan I get this
Error: Invalid resource type
│
│ on main.tf line 49, in resource "google_cloudfunctions2_function" "function":
│ 49: resource "google_cloudfunctions2_function" "function" {
│
│ The provider hashicorp/google-beta does not support resource type "google_cloudfunctions2_function". Did you mean "google_cloudfunctions_function"?
Something I noticed. I can't see a currently existing version 2 cloud function using the gcloud cli:
me@cloudshell:~ (the-project-im-using)$ gcloud functions list
Listed 0 items.
me@cloudshell:~ (the-project-im-using)$ gcloud beta functions list
Listed 0 items.
me@cloudshell:~ (the-project-im-using)$ gcloud alpha functions list
Listed 0 items.
me@cloudshell:~ (the-project-im-using)$
Am I correct in assuming thaat this indicates the version 2 cloud functions are not accessible via rest api?
The reference docs I could find are here: https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/cloudfunctions2_function https://cloud.google.com/functions/docs/tutorials/terraform
Thanks!