Package com.pulumi.gcp.storage
Class BucketAccessControl
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.gcp.storage.BucketAccessControl
-
public class BucketAccessControl extends com.pulumi.resources.CustomResource
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](https://cloud.google.com/storage/docs/json_api/v1/bucketAccessControls) * How-to Guides * [Official Documentation](https://cloud.google.com/storage/docs/access-control/lists) ## Example Usage ### Storage Bucket Access Control Public Bucket ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.gcp.storage.Bucket; import com.pulumi.gcp.storage.BucketArgs; import com.pulumi.gcp.storage.BucketAccessControl; import com.pulumi.gcp.storage.BucketAccessControlArgs; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { var bucket = new Bucket("bucket", BucketArgs.builder() .location("US") .build()); var publicRule = new BucketAccessControl("publicRule", BucketAccessControlArgs.builder() .bucket(bucket.name()) .role("READER") .entity("allUsers") .build()); } } ``` ## Import BucketAccessControl can be imported using any of these accepted formats ```sh $ pulumi import gcp:storage/bucketAccessControl:BucketAccessControl default {{bucket}}/{{entity}} ```
-
-
Constructor Summary
Constructors Constructor Description BucketAccessControl(java.lang.String name)
BucketAccessControl(java.lang.String name, BucketAccessControlArgs args)
BucketAccessControl(java.lang.String name, BucketAccessControlArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.pulumi.core.Output<java.lang.String>
bucket()
com.pulumi.core.Output<java.lang.String>
domain()
com.pulumi.core.Output<java.lang.String>
email()
com.pulumi.core.Output<java.lang.String>
entity()
static BucketAccessControl
get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, BucketAccessControlState state, com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<java.util.Optional<java.lang.String>>
role()
-
-
-
Constructor Detail
-
BucketAccessControl
public BucketAccessControl(java.lang.String name)
- Parameters:
name
- The _unique_ name of the resulting resource.
-
BucketAccessControl
public BucketAccessControl(java.lang.String name, BucketAccessControlArgs args)
- Parameters:
name
- The _unique_ name of the resulting resource.args
- The arguments to use to populate this resource's properties.
-
BucketAccessControl
public BucketAccessControl(java.lang.String name, BucketAccessControlArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)
- Parameters:
name
- The _unique_ name of the resulting resource.args
- The arguments to use to populate this resource's properties.options
- A bag of options that control this resource's behavior.
-
-
Method Detail
-
bucket
public com.pulumi.core.Output<java.lang.String> bucket()
- Returns:
- The name of the bucket.
-
domain
public com.pulumi.core.Output<java.lang.String> domain()
- Returns:
- The domain associated with the entity.
-
email
public com.pulumi.core.Output<java.lang.String> email()
- Returns:
- The email address associated with the entity.
-
entity
public com.pulumi.core.Output<java.lang.String> entity()
- Returns:
- The entity holding the permission, in one of the following forms: user-userId user-email group-groupId group-email domain-domain project-team-projectId allUsers allAuthenticatedUsers Examples: The user [email protected] would be [email protected]. The group [email protected] would be [email protected]. To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com. ***
-
role
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> role()
- Returns:
- The access permission for the entity. Possible values are: `OWNER`, `READER`, `WRITER`.
-
get
public static BucketAccessControl get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable BucketAccessControlState state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name
- The _unique_ name of the resulting resource.id
- The _unique_ provider ID of the resource to lookup.state
-options
- Optional settings to control the behavior of the CustomResource.
-
-