Skip to content

googleStorageBucketAcl

Authoritatively manages a bucket's ACLs in Google cloud storage service (GCS). For more information see the official documentation and API.

Bucket ACLs can be managed non authoritatively using the storageBucketAccessControl resource. Do not use these two resources in conjunction to manage the same bucket.

Permissions can be granted either by ACLs or Cloud IAM policies. In general, permissions granted by Cloud IAM policies do not appear in ACLs, and permissions granted by ACLs do not appear in Cloud IAM policies. The only exception is for ACLs applied directly on a bucket and certain bucket-level Cloud IAM policies, as described in Cloud IAM relation to ACLs.

NOTE This resource will not remove the projectOwners-<projectId> entity from the owner role.

Example Usage

Example creating an ACL on a bucket with one owner, and one reader.

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
const googleStorageBucketImageStore = new google.storageBucket.StorageBucket(
  this,
  "image-store",
  {
    location: "EU",
    name: "image-store-bucket",
  }
);
new google.storageBucketAcl.StorageBucketAcl(this, "image-store-acl", {
  bucket: googleStorageBucketImageStore.name,
  role_entity: ["OWNER:user-my.email@gmail.com", "READER:group-mygroup"],
});

Argument Reference

  • bucket - (Required) The name of the bucket it applies to.

  • predefinedAcl - (Optional) The canned GCS ACL to apply. Must be set if roleEntity is not.

  • roleEntity - (Optional) List of role/entity pairs in the form role:entity. See GCS Bucket ACL documentation for more details. Must be set if predefinedAcl is not.

  • defaultAcl - (Optional) Configure this ACL to be the default ACL.

Attributes Reference

Only the arguments listed above are exposed as attributes.

Import

This resource does not support import.