@pulumiverse/scaleway
Version:
A Pulumi package for creating and managing Scaleway cloud resources.
200 lines • 8.32 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.BucketAcl = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
* The `scaleway.object.BucketAcl` resource allows you to create and manage Access Control Lists (ACLs) for [Scaleway Object storage](https://www.scaleway.com/en/docs/object-storage/).
*
* Refer to the [dedicated documentation](https://www.scaleway.com/en/docs/object-storage/api-cli/bucket-operations/#putbucketacl) for more information on ACLs.
*
* > **Note:** `terraform destroy` does not delete the ACL but does remove the resource from the Terraform state.
*
* > **Note:** [Account identifiers](https://docs.aws.amazon.com/general/latest/gr/acct-identifiers.html) are not supported by Scaleway.
*
* ## 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` - (Optional) The canonical user ID of the grantee.
* * `type` - (Required) Type of grantee. Valid values: CanonicalUser, Group.
* * `uri` - (Optional) The uri of the grantee if type is Group.
*
* ## Import
*
* Bucket ACLs can be imported using the `{region}/{bucketName}/{acl}` identifier, as shown below:
*
* ```sh
* $ pulumi import scaleway:object/bucketAcl:BucketAcl some_bucket fr-par/some-bucket/private
* ```
*
* > **Important:** The `projectId` 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.
*
* ```sh
* $ pulumi import scaleway:object/bucketAcl:BucketAcl some_bucket fr-par/some-bucket/private@xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx
* ```
*/
class BucketAcl extends pulumi.CustomResource {
/**
* Get an existing BucketAcl 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 BucketAcl(name, state, { ...opts, id: id });
}
/** @internal */
static __pulumiType = 'scaleway:object/bucketAcl:BucketAcl';
/**
* Returns true if the given object is an instance of BucketAcl. 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'] === BucketAcl.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["accessControlPolicy"] = state?.accessControlPolicy;
resourceInputs["acl"] = state?.acl;
resourceInputs["bucket"] = state?.bucket;
resourceInputs["expectedBucketOwner"] = state?.expectedBucketOwner;
resourceInputs["projectId"] = state?.projectId;
resourceInputs["region"] = state?.region;
}
else {
const args = argsOrState;
if (args?.bucket === undefined && !opts.urn) {
throw new Error("Missing required property 'bucket'");
}
resourceInputs["accessControlPolicy"] = args?.accessControlPolicy;
resourceInputs["acl"] = args?.acl;
resourceInputs["bucket"] = args?.bucket;
resourceInputs["expectedBucketOwner"] = args?.expectedBucketOwner;
resourceInputs["projectId"] = args?.projectId;
resourceInputs["region"] = args?.region;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const aliasOpts = { aliases: [{ type: "scaleway:index/objectBucketAcl:ObjectBucketAcl" }] };
opts = pulumi.mergeOptions(opts, aliasOpts);
super(BucketAcl.__pulumiType, name, resourceInputs, opts);
}
}
exports.BucketAcl = BucketAcl;
//# sourceMappingURL=bucketAcl.js.map