UNPKG

@pulumi/yandex

Version:

A Pulumi package for creating and managing yandex cloud resources.

89 lines 4.13 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.StorageObject = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Allows management of [Yandex.Cloud Storage Object](https://cloud.yandex.com/docs/storage/concepts/object). * * ## Example Usage * * Example creating an object in an existing `cat-pictures` bucket. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as yandex from "@pulumi/yandex"; * * const cute_cat_picture = new yandex.StorageObject("cute-cat-picture", { * bucket: "cat-pictures", * key: "cute-cat", * source: "/images/cats/cute-cat.jpg", * }); * ``` */ class StorageObject extends pulumi.CustomResource { 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["bucket"] = state ? state.bucket : undefined; resourceInputs["content"] = state ? state.content : undefined; resourceInputs["contentBase64"] = state ? state.contentBase64 : undefined; resourceInputs["contentType"] = state ? state.contentType : undefined; resourceInputs["key"] = state ? state.key : undefined; resourceInputs["secretKey"] = state ? state.secretKey : undefined; resourceInputs["source"] = state ? state.source : undefined; } else { const args = argsOrState; if ((!args || args.bucket === undefined) && !opts.urn) { throw new Error("Missing required property 'bucket'"); } if ((!args || args.key === undefined) && !opts.urn) { throw new Error("Missing required property 'key'"); } resourceInputs["accessKey"] = args ? args.accessKey : undefined; resourceInputs["acl"] = args ? args.acl : undefined; resourceInputs["bucket"] = args ? args.bucket : undefined; resourceInputs["content"] = args ? args.content : undefined; resourceInputs["contentBase64"] = args ? args.contentBase64 : undefined; resourceInputs["contentType"] = args ? args.contentType : undefined; resourceInputs["key"] = args ? args.key : undefined; resourceInputs["secretKey"] = args ? args.secretKey : undefined; resourceInputs["source"] = args ? args.source : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(StorageObject.__pulumiType, name, resourceInputs, opts); } /** * Get an existing StorageObject 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 StorageObject(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of StorageObject. 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'] === StorageObject.__pulumiType; } } exports.StorageObject = StorageObject; /** @internal */ StorageObject.__pulumiType = 'yandex:index/storageObject:StorageObject'; //# sourceMappingURL=storageObject.js.map