UNPKG

@pulumi/linode

Version:

A Pulumi package for creating and managing linode cloud resources.

131 lines 6.16 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.ObjectStorageBucket = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Provides a Linode Object Storage Bucket resource. This can be used to create, modify, and delete Linodes Object Storage Buckets. * For more information, see the [Linode APIv4 docs](https://techdocs.akamai.com/linode-api/reference/post-object-storage-bucket). * * ## Example Usage * * The following example shows how one might use this resource to create an Object Storage Bucket: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as linode from "@pulumi/linode"; * * const foobar = new linode.ObjectStorageBucket("foobar", { * region: "us-mia", * label: "mybucket", * }); * ``` * * Creating an Object Storage Bucket with Lifecycle rules: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as linode from "@pulumi/linode"; * * const mykey = new linode.ObjectStorageKey("mykey", {label: "image-access"}); * const mybucket = new linode.ObjectStorageBucket("mybucket", { * accessKey: mykey.accessKey, * secretKey: mykey.secretKey, * region: "us-mia", * label: "mybucket", * lifecycleRules: [{ * id: "my-rule", * enabled: true, * abortIncompleteMultipartUploadDays: 5, * expiration: { * date: "2021-06-21", * }, * }], * }); * ``` * * Creating an Object Storage Bucket with Lifecycle rules using provider-level object credentials * * ## Import * * Linodes Object Storage Buckets can be imported using the resource `id` which is made of `cluster:label`, e.g. * * ```sh * $ pulumi import linode:index/objectStorageBucket:ObjectStorageBucket mybucket us-east-1:foobar * ``` */ class ObjectStorageBucket extends pulumi.CustomResource { /** * Get an existing ObjectStorageBucket 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 ObjectStorageBucket(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of ObjectStorageBucket. 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'] === ObjectStorageBucket.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["accessKey"] = state ? state.accessKey : undefined; resourceInputs["acl"] = state ? state.acl : undefined; resourceInputs["cert"] = state ? state.cert : undefined; resourceInputs["cluster"] = state ? state.cluster : undefined; resourceInputs["corsEnabled"] = state ? state.corsEnabled : undefined; resourceInputs["endpoint"] = state ? state.endpoint : undefined; resourceInputs["endpointType"] = state ? state.endpointType : undefined; resourceInputs["hostname"] = state ? state.hostname : undefined; resourceInputs["label"] = state ? state.label : undefined; resourceInputs["lifecycleRules"] = state ? state.lifecycleRules : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["s3Endpoint"] = state ? state.s3Endpoint : undefined; resourceInputs["secretKey"] = state ? state.secretKey : undefined; resourceInputs["versioning"] = state ? state.versioning : undefined; } else { const args = argsOrState; if ((!args || args.label === undefined) && !opts.urn) { throw new Error("Missing required property 'label'"); } resourceInputs["accessKey"] = args ? args.accessKey : undefined; resourceInputs["acl"] = args ? args.acl : undefined; resourceInputs["cert"] = args ? args.cert : undefined; resourceInputs["cluster"] = args ? args.cluster : undefined; resourceInputs["corsEnabled"] = args ? args.corsEnabled : undefined; resourceInputs["endpointType"] = args ? args.endpointType : undefined; resourceInputs["label"] = args ? args.label : undefined; resourceInputs["lifecycleRules"] = args ? args.lifecycleRules : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["s3Endpoint"] = args ? args.s3Endpoint : undefined; resourceInputs["secretKey"] = (args === null || args === void 0 ? void 0 : args.secretKey) ? pulumi.secret(args.secretKey) : undefined; resourceInputs["versioning"] = args ? args.versioning : undefined; resourceInputs["endpoint"] = undefined /*out*/; resourceInputs["hostname"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["secretKey"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(ObjectStorageBucket.__pulumiType, name, resourceInputs, opts); } } exports.ObjectStorageBucket = ObjectStorageBucket; /** @internal */ ObjectStorageBucket.__pulumiType = 'linode:index/objectStorageBucket:ObjectStorageBucket'; //# sourceMappingURL=objectStorageBucket.js.map