hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.32k stars 1.73k forks source link

Add resource for Managed Folders in GCS #18053

Open eh-john opened 5 months ago

eh-john commented 5 months ago

Community Note

Description

There is a new managed folder feature for GCS that can't be created in terraform yet. It appears to have API support already as it describes the REST APIs needed to create one in the docs.

It looks like the version of the Go SDK that this is using supports it too.

Having this resource available allows one to set permissions at a path level in GCS.

New or Affected Resource(s)

Potential Terraform Configuration

resource "google_storage_managed_folder" "managed_folder" {
    bucket = "bucket here"
    name   = "folder_name"
}
data "google_storage_managed_folder" "managed_folder" {
    bucket = "bucket here"
    name   = "folder_name"
}

References

https://cloud.google.com/storage/docs/creating-managing-managed-folders#rest-apis_1 https://cloud.google.com/storage/docs/managed-folders

b/340252275

hassannmoussaa commented 4 months ago

Please assign this issue to me , ill open a PR for it

SarahFrench commented 4 months ago

Note from triage: This is the API for the new resource https://cloud.google.com/storage/docs/json_api/v1/managedFolder/insert

juliocc commented 4 months ago

Apologies for the overlap! I didn't realize this was already assigned and I started working on it due to an urgent customer request. My PR (GoogleCloudPlatform/magic-modules#10786) already incorporates IAM and addresses all the details with import. Hope we can work this out.

/cc @ludoo