UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

105 lines 4.29 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.ObjectACL = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Authoritatively manages the access control list (ACL) for an object in a Google * Cloud Storage (GCS) bucket. Removing a `gcp.storage.ObjectACL` sets the * acl to the `private` [predefined ACL](https://cloud.google.com/storage/docs/access-control#predefined-acl). * * For more information see * [the official documentation](https://cloud.google.com/storage/docs/access-control/lists) * and * [API](https://cloud.google.com/storage/docs/json_api/v1/objectAccessControls). * * > Want fine-grained control over object ACLs? Use `gcp.storage.ObjectAccessControl` to control individual * role entity pairs. * * ## Example Usage * * Create an object ACL with one owner and one reader. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const image_store = new gcp.storage.Bucket("image-store", { * name: "image-store-bucket", * location: "EU", * }); * const image = new gcp.storage.BucketObject("image", { * name: "image1", * bucket: image_store.name, * source: new pulumi.asset.FileAsset("image1.jpg"), * }); * const image_store_acl = new gcp.storage.ObjectACL("image-store-acl", { * bucket: image_store.name, * object: image.outputName, * roleEntities: [ * "OWNER:user-my.email@gmail.com", * "READER:group-mygroup", * ], * }); * ``` * * ## Import * * This resource does not support import. */ class ObjectACL extends pulumi.CustomResource { /** * Get an existing ObjectACL resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, state, opts) { return new ObjectACL(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of ObjectACL. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === ObjectACL.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["bucket"] = state ? state.bucket : undefined; resourceInputs["object"] = state ? state.object : undefined; resourceInputs["predefinedAcl"] = state ? state.predefinedAcl : undefined; resourceInputs["roleEntities"] = state ? state.roleEntities : undefined; } else { const args = argsOrState; if ((!args || args.bucket === undefined) && !opts.urn) { throw new Error("Missing required property 'bucket'"); } if ((!args || args.object === undefined) && !opts.urn) { throw new Error("Missing required property 'object'"); } resourceInputs["bucket"] = args ? args.bucket : undefined; resourceInputs["object"] = args ? args.object : undefined; resourceInputs["predefinedAcl"] = args ? args.predefinedAcl : undefined; resourceInputs["roleEntities"] = args ? args.roleEntities : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ObjectACL.__pulumiType, name, resourceInputs, opts); } } exports.ObjectACL = ObjectACL; /** @internal */ ObjectACL.__pulumiType = 'gcp:storage/objectACL:ObjectACL'; //# sourceMappingURL=objectACL.js.map