@pulumiverse/scaleway
Version:
A Pulumi package for creating and managing Scaleway cloud resources.
176 lines • 7.45 kB
JavaScript
;
// *** 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 "@pulumiverse/scaleway";
*
* const someBucket = new scaleway.object.Bucket("some_bucket", {name: "unique-name"});
* const main = new scaleway.object.BucketAcl("main", {
* bucket: mainScalewayObjectBucket.id,
* acl: "private",
* });
* ```
*
* For more information, refer to the [PutBucketAcl API call documentation](https://www.scaleway.com/en/docs/object-storage/api-cli/bucket-operations/#putbucketacl).
*
* ### With Grants
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@pulumiverse/scaleway";
*
* const main = new scaleway.object.Bucket("main", {name: "your-bucket"});
* const mainBucketAcl = new scaleway.object.BucketAcl("main", {
* bucket: main.id,
* 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
*
* Refer to the [official canned ACL documentation](https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl_overview.html#canned-acl) for more information on the different roles.
*
* ## 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
*
* Bucket ACLs can be imported using the `{region}/{bucketName}/{acl}` identifier, as shown below:
*
* bash
*
* ```sh
* $ pulumi import scaleway:index/objectBucketAcl:ObjectBucketAcl some_bucket fr-par/some-bucket/private
* ```
*
* ~> **Important:** The `project_id` attribute has a particular behavior with s3 products because the s3 API is scoped by project.
*
* If you are using a project different from the default one, you have to specify the project ID at the end of the import command.
*
* bash
*
* ```sh
* $ pulumi import scaleway:index/objectBucketAcl:ObjectBucketAcl some_bucket fr-par/some-bucket/private@xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx
* ```
*
* @deprecated scaleway.index/objectbucketacl.ObjectBucketAcl has been deprecated in favor of scaleway.object/bucketacl.BucketAcl
*/
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) {
pulumi.log.warn("ObjectBucketAcl is deprecated: scaleway.index/objectbucketacl.ObjectBucketAcl has been deprecated in favor of scaleway.object/bucketacl.BucketAcl");
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;
}
/** @deprecated scaleway.index/objectbucketacl.ObjectBucketAcl has been deprecated in favor of scaleway.object/bucketacl.BucketAcl */
constructor(name, argsOrState, opts) {
pulumi.log.warn("ObjectBucketAcl is deprecated: scaleway.index/objectbucketacl.ObjectBucketAcl has been deprecated in favor of scaleway.object/bucketacl.BucketAcl");
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