Object Access Control Args
The ObjectAccessControls resources represent the Access Control Lists (ACLs) for objects within Google Cloud Storage. ACLs let you specify who has access to your data and to what extent. There are two roles that can be assigned to an entity: READERs can get an object, though the acl property will not be revealed. OWNERs are READERs, and they can get the acl property, update an object, and call all objectAccessControls methods on the object. The owner of an object is always an OWNER. For more information, see Access Control, with the caveat that this API uses READER and OWNER instead of READ and FULL_CONTROL. To get more information about ObjectAccessControl, see:
How-to Guides
Example Usage
Storage Object Access Control Public Object
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.BucketObject;
import com.pulumi.gcp.storage.BucketObjectArgs;
import com.pulumi.gcp.storage.ObjectAccessControl;
import com.pulumi.gcp.storage.ObjectAccessControlArgs;
import com.pulumi.asset.FileAsset;
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 object = new BucketObject("object", BucketObjectArgs.builder()
.bucket(bucket.name())
.source(new FileAsset("../static/img/header-logo.png"))
.build());
var publicRule = new ObjectAccessControl("publicRule", ObjectAccessControlArgs.builder()
.object(object.outputName())
.bucket(bucket.name())
.role("READER")
.entity("allUsers")
.build());
}
}
Import
ObjectAccessControl can be imported using any of these accepted formats:
$ pulumi import gcp:storage/objectAccessControl:ObjectAccessControl default {{bucket}}/{{object}}/{{entity}}