@upcloud/pulumi-upcloud
Version:
A Pulumi package for creating and managing UpCloud resources.
197 lines (196 loc) • 9.4 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
* > The `upcloud.ObjectStorage` resource manages previous generatation object storage instances that will reach end of life (EOL) by the end of 2024. For new instances, consider using the new Object Storage product managed with `upcloud.ManagedObjectStorage` resource.
*
* This resource represents an UpCloud Object Storage instance, which provides S3 compatible storage.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as upcloud from "@upcloud/pulumi-upcloud";
*
* // Object storage instance called storage-name in the fi-hel2 zone, with 2 buckets called "products" and "images".
* const myObjectStorage = new upcloud.ObjectStorage("my_object_storage", {
* size: 250,
* name: "storage-name",
* zone: "fi-hel2",
* accessKey: "admin",
* secretKey: "changeme",
* description: "catalogue",
* buckets: [
* {
* name: "products",
* },
* {
* name: "images",
* },
* ],
* });
* ```
*
* ## Import
*
* For object storage import to work properly, you need to set environment variables for access and secret key.
*
* The environment variables names are UPCLOUD_OBJECT_STORAGE_ACCESS_KEY_{name} and UPCLOUD_OBJECT_STORAGE_SECRET_KEY_{name}
*
* where {name} is the name of your object storage instance (not the resource label!), all uppercased, and with all dashes (-)
*
* replaced with underscores (_). So importing an object storage that is named "my-storage" will look like this:
*
* UPCLOUD_OBJECT_STORAGE_ACCESS_KEY_MY_STORAGE=accesskey \
*
* UPCLOUD_OBJECT_STORAGE_SECRET_KEY_MY_STORAGE=supersecret \
*
* ```sh
* $ pulumi import upcloud:index/objectStorage:ObjectStorage example_storage 06c1f4b6-faf2-47d0-8896-1d941092b009
* ```
*/
export declare class ObjectStorage extends pulumi.CustomResource {
/**
* Get an existing ObjectStorage 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: string, id: pulumi.Input<pulumi.ID>, state?: ObjectStorageState, opts?: pulumi.CustomResourceOptions): ObjectStorage;
/**
* Returns true if the given object is an instance of ObjectStorage. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is ObjectStorage;
/**
* The access key used to identify user. Can be set to an empty string, which will tell the provider to get the access key
* from environment variable. The environment variable should be "UPCLOUD_OBJECT_STORAGE_ACCESS_KEY_{name}". {name} is the
* name given to object storage instance (so not the resource label), it should be all uppercased and all dashes (-) should
* be replaced with underscores (_). For example, object storage named "my-files" would use environment variable named
* "UPCLOUD_OBJECT_STORAGE_ACCESS_KEY_MY_FILES".
*/
readonly accessKey: pulumi.Output<string>;
readonly buckets: pulumi.Output<outputs.ObjectStorageBucket[] | undefined>;
readonly created: pulumi.Output<string>;
/**
* The description of the object storage instance to be created
*/
readonly description: pulumi.Output<string>;
/**
* The name of the object storage instance to be created
*/
readonly name: pulumi.Output<string>;
/**
* The secret key used to authenticate user. Can be set to an empty string, which will tell the provider to get the secret
* key from environment variable. The environment variable should be "UPCLOUD_OBJECT_STORAGE_SECRET_KEY_{name}". {name} is
* the name given to object storage instance (so not the resource label), it should be all uppercased and all dashes (-)
* should be replaced with underscores (_). For example, object storage named "my-files" would use environment variable
* named "UPCLOUD_OBJECT_STORAGE_SECRET_KEY_MY_FILES".
*/
readonly secretKey: pulumi.Output<string>;
/**
* The size of the object storage instance in gigabytes
*/
readonly size: pulumi.Output<number>;
readonly state: pulumi.Output<string>;
readonly url: pulumi.Output<string>;
readonly usedSpace: pulumi.Output<number>;
/**
* The zone in which the object storage instance will be created, e.g. `de-fra1`. You can list available zones with `upctl
* zone list`.
*/
readonly zone: pulumi.Output<string>;
/**
* Create a ObjectStorage resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: ObjectStorageArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering ObjectStorage resources.
*/
export interface ObjectStorageState {
/**
* The access key used to identify user. Can be set to an empty string, which will tell the provider to get the access key
* from environment variable. The environment variable should be "UPCLOUD_OBJECT_STORAGE_ACCESS_KEY_{name}". {name} is the
* name given to object storage instance (so not the resource label), it should be all uppercased and all dashes (-) should
* be replaced with underscores (_). For example, object storage named "my-files" would use environment variable named
* "UPCLOUD_OBJECT_STORAGE_ACCESS_KEY_MY_FILES".
*/
accessKey?: pulumi.Input<string>;
buckets?: pulumi.Input<pulumi.Input<inputs.ObjectStorageBucket>[]>;
created?: pulumi.Input<string>;
/**
* The description of the object storage instance to be created
*/
description?: pulumi.Input<string>;
/**
* The name of the object storage instance to be created
*/
name?: pulumi.Input<string>;
/**
* The secret key used to authenticate user. Can be set to an empty string, which will tell the provider to get the secret
* key from environment variable. The environment variable should be "UPCLOUD_OBJECT_STORAGE_SECRET_KEY_{name}". {name} is
* the name given to object storage instance (so not the resource label), it should be all uppercased and all dashes (-)
* should be replaced with underscores (_). For example, object storage named "my-files" would use environment variable
* named "UPCLOUD_OBJECT_STORAGE_SECRET_KEY_MY_FILES".
*/
secretKey?: pulumi.Input<string>;
/**
* The size of the object storage instance in gigabytes
*/
size?: pulumi.Input<number>;
state?: pulumi.Input<string>;
url?: pulumi.Input<string>;
usedSpace?: pulumi.Input<number>;
/**
* The zone in which the object storage instance will be created, e.g. `de-fra1`. You can list available zones with `upctl
* zone list`.
*/
zone?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a ObjectStorage resource.
*/
export interface ObjectStorageArgs {
/**
* The access key used to identify user. Can be set to an empty string, which will tell the provider to get the access key
* from environment variable. The environment variable should be "UPCLOUD_OBJECT_STORAGE_ACCESS_KEY_{name}". {name} is the
* name given to object storage instance (so not the resource label), it should be all uppercased and all dashes (-) should
* be replaced with underscores (_). For example, object storage named "my-files" would use environment variable named
* "UPCLOUD_OBJECT_STORAGE_ACCESS_KEY_MY_FILES".
*/
accessKey: pulumi.Input<string>;
buckets?: pulumi.Input<pulumi.Input<inputs.ObjectStorageBucket>[]>;
/**
* The description of the object storage instance to be created
*/
description: pulumi.Input<string>;
/**
* The name of the object storage instance to be created
*/
name?: pulumi.Input<string>;
/**
* The secret key used to authenticate user. Can be set to an empty string, which will tell the provider to get the secret
* key from environment variable. The environment variable should be "UPCLOUD_OBJECT_STORAGE_SECRET_KEY_{name}". {name} is
* the name given to object storage instance (so not the resource label), it should be all uppercased and all dashes (-)
* should be replaced with underscores (_). For example, object storage named "my-files" would use environment variable
* named "UPCLOUD_OBJECT_STORAGE_SECRET_KEY_MY_FILES".
*/
secretKey: pulumi.Input<string>;
/**
* The size of the object storage instance in gigabytes
*/
size: pulumi.Input<number>;
/**
* The zone in which the object storage instance will be created, e.g. `de-fra1`. You can list available zones with `upctl
* zone list`.
*/
zone: pulumi.Input<string>;
}