UNPKG

@pulumiverse/scaleway

Version:

A Pulumi package for creating and managing Scaleway cloud resources.

297 lines 10.5 kB
"use strict"; // *** 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.ObjectBucket = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("./utilities")); /** * The `scaleway.object.Bucket` resource allows you to create and manage buckets 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/how-to/create-a-bucket/) for more information on Object Storage buckets. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * const someBucket = new scaleway.object.Bucket("some_bucket", { * name: "some-unique-name", * tags: { * key: "value", * }, * }); * ``` * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * const main = new scaleway.object.Bucket("main", { * name: "mybuckectid", * region: "fr-par", * lifecycleRules: [ * { * id: "id1", * prefix: "path1/", * enabled: true, * expiration: { * days: 365, * }, * transitions: [{ * days: 120, * storageClass: "GLACIER", * }], * }, * { * id: "id2", * prefix: "path2/", * enabled: true, * expiration: { * days: 50, * }, * }, * { * id: "id3", * prefix: "path3/", * enabled: false, * tags: { * tagKey: "tagValue", * terraform: "hashicorp", * }, * expiration: { * days: 1, * }, * }, * { * id: "id4", * enabled: true, * tags: { * tag1: "value1", * }, * transitions: [{ * days: 1, * storageClass: "GLACIER", * }], * }, * { * enabled: true, * abortIncompleteMultipartUploadDays: 30, * }, * ], * }); * ``` * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * const main = new scaleway.object.Bucket("main", { * name: "mybuckectid", * region: "fr-par", * lifecycleRules: [{ * id: "id1", * prefix: "path1/", * enabled: true, * noncurrentVersionExpiration: { * noncurrentDays: 90, * }, * noncurrentVersionTransitions: [ * { * noncurrentDays: 30, * storageClass: "ONEZONE_IA", * }, * { * noncurrentDays: 60, * storageClass: "GLACIER", * }, * ], * }], * }); * ``` * * ### Creating the bucket in a specific project * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * const someBucket = new scaleway.object.Bucket("some_bucket", { * name: "some-unique-name", * projectId: "11111111-1111-1111-1111-111111111111", * }); * ``` * * ### Using object lifecycle * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * const main = new scaleway.object.Bucket("main", { * name: "mybuckectid", * region: "fr-par", * lifecycleRules: [ * { * id: "id1", * prefix: "path1/", * enabled: true, * expiration: { * days: 365, * }, * transitions: [{ * days: 120, * storageClass: "GLACIER", * }], * }, * { * id: "id2", * prefix: "path2/", * enabled: true, * expiration: { * days: 50, * }, * }, * { * id: "id3", * prefix: "path3/", * enabled: false, * tags: { * tagKey: "tagValue", * terraform: "hashicorp", * }, * expiration: { * days: 1, * }, * }, * { * id: "id4", * enabled: true, * tags: { * tag1: "value1", * }, * transitions: [{ * days: 1, * storageClass: "GLACIER", * }], * }, * { * enabled: true, * abortIncompleteMultipartUploadDays: 30, * }, * ], * }); * ``` * * ## Import * * Buckets can be imported using the `{region}/{bucketName}` identifier, as shown below: * * ```sh * $ pulumi import scaleway:index/objectBucket:ObjectBucket some_bucket fr-par/some-bucket * ``` * * > **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:index/objectBucket:ObjectBucket some_bucket fr-par/some-bucket@11111111-1111-1111-1111-111111111111 * ``` * * <!--- Links, invisible in the final document ---> * * [1]: https://www.scaleway.com/en/docs/object-storage/concepts/#storage-class * * @deprecated scaleway.index/objectbucket.ObjectBucket has been deprecated in favor of scaleway.object/bucket.Bucket */ class ObjectBucket extends pulumi.CustomResource { /** * Get an existing ObjectBucket 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("ObjectBucket is deprecated: scaleway.index/objectbucket.ObjectBucket has been deprecated in favor of scaleway.object/bucket.Bucket"); return new ObjectBucket(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'scaleway:index/objectBucket:ObjectBucket'; /** * Returns true if the given object is an instance of ObjectBucket. 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'] === ObjectBucket.__pulumiType; } /** @deprecated scaleway.index/objectbucket.ObjectBucket has been deprecated in favor of scaleway.object/bucket.Bucket */ constructor(name, argsOrState, opts) { pulumi.log.warn("ObjectBucket is deprecated: scaleway.index/objectbucket.ObjectBucket has been deprecated in favor of scaleway.object/bucket.Bucket"); let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["acl"] = state?.acl; resourceInputs["apiEndpoint"] = state?.apiEndpoint; resourceInputs["corsRules"] = state?.corsRules; resourceInputs["endpoint"] = state?.endpoint; resourceInputs["forceDestroy"] = state?.forceDestroy; resourceInputs["lifecycleRules"] = state?.lifecycleRules; resourceInputs["name"] = state?.name; resourceInputs["objectLockEnabled"] = state?.objectLockEnabled; resourceInputs["projectId"] = state?.projectId; resourceInputs["region"] = state?.region; resourceInputs["tags"] = state?.tags; resourceInputs["versioning"] = state?.versioning; } else { const args = argsOrState; resourceInputs["acl"] = args?.acl; resourceInputs["corsRules"] = args?.corsRules; resourceInputs["forceDestroy"] = args?.forceDestroy; resourceInputs["lifecycleRules"] = args?.lifecycleRules; resourceInputs["name"] = args?.name; resourceInputs["objectLockEnabled"] = args?.objectLockEnabled; resourceInputs["projectId"] = args?.projectId; resourceInputs["region"] = args?.region; resourceInputs["tags"] = args?.tags; resourceInputs["versioning"] = args?.versioning; resourceInputs["apiEndpoint"] = undefined /*out*/; resourceInputs["endpoint"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ObjectBucket.__pulumiType, name, resourceInputs, opts); } } exports.ObjectBucket = ObjectBucket; //# sourceMappingURL=objectBucket.js.map