How to import bucket_access_control with terraform (gcp)?

Viewed 19

I am trying to import a bucket permission with

terraform import google_storage_bucket_access_control.public_rule banana/allUsers

my tf files

resource "google_storage_bucket" "banana" {
  name = "banana"
  location = "us-central1"
  uniform_bucket_level_access = true
}
resource "google_storage_bucket_access_control" "public_rule" {
  bucket = google_storage_bucket.banana.name
  role   = "READER"
  entity = "allUsers"
}

and received this error:

Error: Error when reading or editing StorageBucketAccessControl "banana/allUsers": googleapi: Error 400: Cannot get legacy ACL for a bucket that has uniform bucket-level access. Read more at https://cloud.google.com/storage/docs/uniform-bucket-level-access, invalid

What I can do to fix/troubleshoot it? Thanks in advance / sorry for the noob question

0 Answers
Related