@pulumiverse/scaleway
Version:
A Pulumi package for creating and managing Scaleway cloud resources.
111 lines • 5.95 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.ObjectItem = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* The `scaleway.object.Item` resource allows you to create and manage objects 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/upload-files-into-a-bucket/) for more information on Object Storage objects.
*
* ## Import
*
* Objects can be imported using the `{region}/{bucketName}/{objectKey}` identifier, as shown below:
*
* bash
*
* ```sh
* $ pulumi import scaleway:index/objectItem:ObjectItem some_object fr-par/some-bucket/some-file
* ```
*
* ~> **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/objectItem:ObjectItem some_object fr-par/some-bucket/some-file@xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx
* ```
*
* @deprecated scaleway.index/objectitem.ObjectItem has been deprecated in favor of scaleway.object/item.Item
*/
class ObjectItem extends pulumi.CustomResource {
/**
* Get an existing ObjectItem 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("ObjectItem is deprecated: scaleway.index/objectitem.ObjectItem has been deprecated in favor of scaleway.object/item.Item");
return new ObjectItem(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ObjectItem. 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'] === ObjectItem.__pulumiType;
}
/** @deprecated scaleway.index/objectitem.ObjectItem has been deprecated in favor of scaleway.object/item.Item */
constructor(name, argsOrState, opts) {
pulumi.log.warn("ObjectItem is deprecated: scaleway.index/objectitem.ObjectItem has been deprecated in favor of scaleway.object/item.Item");
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["bucket"] = state ? state.bucket : undefined;
resourceInputs["content"] = state ? state.content : undefined;
resourceInputs["contentBase64"] = state ? state.contentBase64 : undefined;
resourceInputs["file"] = state ? state.file : undefined;
resourceInputs["hash"] = state ? state.hash : undefined;
resourceInputs["key"] = state ? state.key : undefined;
resourceInputs["metadata"] = state ? state.metadata : undefined;
resourceInputs["projectId"] = state ? state.projectId : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["sseCustomerKey"] = state ? state.sseCustomerKey : undefined;
resourceInputs["storageClass"] = state ? state.storageClass : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["visibility"] = state ? state.visibility : 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["bucket"] = args ? args.bucket : undefined;
resourceInputs["content"] = args ? args.content : undefined;
resourceInputs["contentBase64"] = args ? args.contentBase64 : undefined;
resourceInputs["file"] = args ? args.file : undefined;
resourceInputs["hash"] = args ? args.hash : undefined;
resourceInputs["key"] = args ? args.key : undefined;
resourceInputs["metadata"] = args ? args.metadata : undefined;
resourceInputs["projectId"] = args ? args.projectId : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["sseCustomerKey"] = (args === null || args === void 0 ? void 0 : args.sseCustomerKey) ? pulumi.secret(args.sseCustomerKey) : undefined;
resourceInputs["storageClass"] = args ? args.storageClass : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["visibility"] = args ? args.visibility : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["sseCustomerKey"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(ObjectItem.__pulumiType, name, resourceInputs, opts);
}
}
exports.ObjectItem = ObjectItem;
/** @internal */
ObjectItem.__pulumiType = 'scaleway:index/objectItem:ObjectItem';
//# sourceMappingURL=objectItem.js.map