Expand description
Bucket ACLs can be managed authoritatively using the
storage_bucket_acl
resource. Do not use these two resources in conjunction to manage the same bucket.
The BucketAccessControls resource manages the Access Control List (ACLs) for a single entity/role pairing on a bucket. ACLs let you specify who has access to your data and to what extent.
There are three roles that can be assigned to an entity:
READERs can get the bucket, though no acl property will be returned, and list the bucket’s objects. WRITERs are READERs, and they can insert objects into the bucket and delete the bucket’s objects. OWNERs are WRITERs, and they can get the acl property of a bucket, update a bucket, and call all BucketAccessControls methods on the bucket. For more information, see Access Control, with the caveat that this API uses READER, WRITER, and OWNER instead of READ, WRITE, and FULL_CONTROL.
To get more information about BucketAccessControl, see:
- API documentation
- How-to Guides
§Example Usage
§Storage Bucket Access Control Public Bucket
use pulumi_wasm_rust::Output;
use pulumi_wasm_rust::{add_export, pulumi_main};
#[pulumi_main]
fn test_main() -> Result<(), Error> {
let bucket = bucket::create(
"bucket",
BucketArgs::builder().location("US").name("static-content-bucket").build_struct(),
);
let publicRule = bucket_access_control::create(
"publicRule",
BucketAccessControlArgs::builder()
.bucket("${bucket.name}")
.entity("allUsers")
.role("READER")
.build_struct(),
);
}
§Import
BucketAccessControl can be imported using any of these accepted formats:
{{bucket}}/{{entity}}
When using the pulumi import
command, BucketAccessControl can be imported using one of the formats above. For example:
$ pulumi import gcp:storage/bucketAccessControl:BucketAccessControl default {{bucket}}/{{entity}}
Structs§
- Use builder syntax to set the inputs and finish with
build_struct()
.
Functions§
- Registers a new resource with the given unique name and arguments