UNPKG

@lbrlabs/pulumi-scaleway

Version:

A Pulumi package for creating and managing scaleway cloud resources.

158 lines 6.18 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.ObjectBucketAcl = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@lbrlabs/pulumi-scaleway"; * * const someBucket = new scaleway.ObjectBucket("someBucket", {}); * const main = new scaleway.ObjectBucketAcl("main", { * bucket: scaleway_object_bucket.main.name, * acl: "private", * }); * ``` * ## Example with Grants * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@lbrlabs/pulumi-scaleway"; * * const mainObjectBucket = new scaleway.ObjectBucket("mainObjectBucket", {}); * const mainObjectBucketAcl = new scaleway.ObjectBucketAcl("mainObjectBucketAcl", { * bucket: mainObjectBucket.name, * accessControlPolicy: { * grants: [ * { * grantee: { * id: "<project-id>:<project-id>", * type: "CanonicalUser", * }, * permission: "FULL_CONTROL", * }, * { * grantee: { * id: "<project-id>", * type: "CanonicalUser", * }, * permission: "WRITE", * }, * ], * owner: { * id: "<project-id>", * }, * }, * }); * ``` * * ## The ACL * * Please check the [canned ACL](https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl_overview.html#canned-acl) * * ## The Access Control policy * * The `accessControlPolicy` configuration block supports the following arguments: * * * `grant` - (Required) Set of grant configuration blocks documented below. * * `owner` - (Required) Configuration block of the bucket owner's display name and ID documented below. * * ## The Grant * * The `grant` configuration block supports the following arguments: * * * `grantee` - (Required) Configuration block for the project being granted permissions documented below. * * `permission` - (Required) Logging permissions assigned to the grantee for the bucket. * * ## The permission * * The following list shows each access policy permissions supported. * * `READ`, `WRITE`, `READ_ACP`, `WRITE_ACP`, `FULL_CONTROL` * * For more information about ACL permissions in the S3 bucket, see [ACL permissions](https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl-overview.html). * * ## The owner * * The `owner` configuration block supports the following arguments: * * * `id` - (Required) The ID of the project owner. * * `displayName` - (Optional) The display name of the owner. * * ## the grantee * * The `grantee` configuration block supports the following arguments: * * * `id` - (Required) The canonical user ID of the grantee. * * `type` - (Required) Type of grantee. Valid values: CanonicalUser. * * ## Import * * Buckets can be imported using the `{region}/{bucketName}/{acl}` identifier, e.g. bash * * ```sh * $ pulumi import scaleway:index/objectBucketAcl:ObjectBucketAcl some_bucket fr-par/some-bucket * ``` * * /private */ class ObjectBucketAcl extends pulumi.CustomResource { /** * Get an existing ObjectBucketAcl 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 ObjectBucketAcl(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of ObjectBucketAcl. 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'] === ObjectBucketAcl.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["accessControlPolicy"] = state ? state.accessControlPolicy : undefined; resourceInputs["acl"] = state ? state.acl : undefined; resourceInputs["bucket"] = state ? state.bucket : undefined; resourceInputs["expectedBucketOwner"] = state ? state.expectedBucketOwner : undefined; resourceInputs["projectId"] = state ? state.projectId : undefined; resourceInputs["region"] = state ? state.region : undefined; } else { const args = argsOrState; if ((!args || args.bucket === undefined) && !opts.urn) { throw new Error("Missing required property 'bucket'"); } resourceInputs["accessControlPolicy"] = args ? args.accessControlPolicy : undefined; resourceInputs["acl"] = args ? args.acl : undefined; resourceInputs["bucket"] = args ? args.bucket : undefined; resourceInputs["expectedBucketOwner"] = args ? args.expectedBucketOwner : undefined; resourceInputs["projectId"] = args ? args.projectId : undefined; resourceInputs["region"] = args ? args.region : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ObjectBucketAcl.__pulumiType, name, resourceInputs, opts); } } exports.ObjectBucketAcl = ObjectBucketAcl; /** @internal */ ObjectBucketAcl.__pulumiType = 'scaleway:index/objectBucketAcl:ObjectBucketAcl'; //# sourceMappingURL=objectBucketAcl.js.map