terraform-provider-google icon indicating copy to clipboard operation
terraform-provider-google copied to clipboard

Missing data source google_cloudfunctions2_function

Open yuryu opened this issue 2 years ago • 2 comments

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment. If the issue is assigned to the "modular-magician" user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If the issue is assigned to a user, that user is claiming responsibility for the issue. If the issue is assigned to "hashibot", a community member has claimed the issue already.

Description

The current google_cloudfunctions_function data source cannot retrieve info for Cloud Functions 2nd gen functions. We need a data source equivalent of the google_cloudfunctions2_function resource to get functions created outside of Terraform.

New or Affected Resource(s)

  • google_cloudfunctions_function
  • google_cloudfunctions2_function

Potential Terraform Configuration

# Propose what you think the configuration to take advantage of this feature should look like.
# We may not use it verbatim, but it's helpful in understanding your intent.
data "google_cloudfunctions2_function" "function" {
  provider = google-beta
  name     = "gen2-function"
  region   = "us-central1"
}

References

yuryu avatar Mar 09 '22 04:03 yuryu

I think this is overall a much bigger issue than just missing the data resource.

Essentially their APIs cannot list/read the 2st Gen functions. I've reported the bug here: https://issuetracker.google.com/issues/237683973

Aur0nd avatar Jul 01 '22 13:07 Aur0nd

I have added in above issue in google issue tracker. But gcloud functions list seems to be working fine and list all gen2 functions as well.

urwa avatar Sep 19 '22 05:09 urwa

@yuryu can you confirm this works as expected now? As of Sept 20th the gcloud fix should be live.

k-ezis avatar Nov 16 '22 18:11 k-ezis

I believe the data source is available now, https://registry.terraform.io/providers/hashicorp/google/latest/docs/data-sources/cloudfunctions2_function

Merged as part of https://github.com/GoogleCloudPlatform/magic-modules/pull/6523

stenalpjolly avatar Nov 25 '22 04:11 stenalpjolly

Confirmed this appears to be fixed, thanks for the comments here

roaks3 avatar Nov 29 '22 17:11 roaks3

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

github-actions[bot] avatar Dec 30 '22 02:12 github-actions[bot]