@pulumi/openstack
Version:
A Pulumi package for creating and managing OpenStack cloud resources.
397 lines (396 loc) • 14.4 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* Manages a V1 container resource within OpenStack.
*
* ## Example Usage
*
* ### Basic Container
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as openstack from "@pulumi/openstack";
*
* const container1 = new openstack.objectstorage.Container("container_1", {
* region: "RegionOne",
* name: "tf-test-container-1",
* metadata: {
* test: "true",
* },
* contentType: "application/json",
* versioning: true,
* });
* ```
*
* ### Basic Container with legacy versioning
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as openstack from "@pulumi/openstack";
*
* const container1 = new openstack.objectstorage.Container("container_1", {
* region: "RegionOne",
* name: "tf-test-container-1",
* metadata: {
* test: "true",
* },
* contentType: "application/json",
* versioningLegacy: {
* type: "versions",
* location: "tf-test-container-versions",
* },
* });
* ```
*
* ### Global Read Access
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as openstack from "@pulumi/openstack";
*
* // Requires that a user know the object name they are attempting to download
* const container1 = new openstack.objectstorage.Container("container_1", {
* region: "RegionOne",
* name: "tf-test-container-1",
* containerRead: ".r:*",
* });
* ```
*
* ### Global Read and List Access
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as openstack from "@pulumi/openstack";
*
* // Any user can read any object, and list all objects in the container
* const container1 = new openstack.objectstorage.Container("container_1", {
* region: "RegionOne",
* name: "tf-test-container-1",
* containerRead: ".r:*,.rlistings",
* });
* ```
*
* ### Write-Only Access for a User
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as openstack from "@pulumi/openstack";
*
* const current = openstack.identity.getAuthScope({
* name: "current",
* });
* // The named user can only upload objects, not read objects or list the container
* const container1 = new openstack.objectstorage.Container("container_1", {
* region: "RegionOne",
* name: "tf-test-container-1",
* containerRead: `.r:-${username}`,
* containerWrite: current.then(current => `${current.projectId}:${username}`),
* });
* ```
*
* ### Set a custom storage class in the Ceph RGW Swift API
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as openstack from "@pulumi/openstack";
*
* const container1 = new openstack.objectstorage.Container("container_1", {
* name: "tf-test-container-1",
* storagePolicy: "az1",
* storageClass: "SSD",
* });
* ```
*
* ## Import
*
* This resource can be imported by specifying the name of the container:
*
* Some attributes can't be imported :
* * `force_destroy`
* * `content_type`
* * `metadata`
* * `container_sync_to`
* * `container_sync_key`
*
* So you'll have to `pulumi preview` and `pulumi up` after the import to fix those missing attributes.
*
* ```sh
* $ pulumi import openstack:objectstorage/container:Container container_1 container_name
* ```
*/
export declare class Container extends pulumi.CustomResource {
/**
* Get an existing Container 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?: ContainerState, opts?: pulumi.CustomResourceOptions): Container;
/**
* Returns true if the given object is an instance of Container. 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 Container;
/**
* Sets an access control list (ACL) that grants
* read access. This header can contain a comma-delimited list of users that can
* read the container (allows the GET method for all objects in the container).
* Changing this updates the access control list read access.
*/
readonly containerRead: pulumi.Output<string | undefined>;
/**
* The secret key for container
* synchronization. Changing this updates container synchronization.
*/
readonly containerSyncKey: pulumi.Output<string | undefined>;
/**
* The destination for container
* synchronization. Changing this updates container synchronization.
*/
readonly containerSyncTo: pulumi.Output<string | undefined>;
/**
* Sets an ACL that grants write access. Changing
* this updates the access control list write access.
*/
readonly containerWrite: pulumi.Output<string | undefined>;
/**
* The MIME type for the container. Changing this
* updates the MIME type.
*/
readonly contentType: pulumi.Output<string | undefined>;
/**
* A boolean that indicates all
* objects should be deleted from the container so that the container can be
* destroyed without error. These objects are not recoverable.
*/
readonly forceDestroy: pulumi.Output<boolean | undefined>;
/**
* Custom key/value pairs to associate with the
* container. Changing this updates the existing container metadata.
*/
readonly metadata: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* A unique name for the container. Changing this creates a
* new container.
*/
readonly name: pulumi.Output<string>;
/**
* The region in which to create the container. If
* omitted, the `region` argument of the provider is used. Changing this creates
* a new container.
*/
readonly region: pulumi.Output<string>;
/**
* The storage class to be used for the container.
* Changing this creates a new container. This option is only available in Ceph
* RGW Swift API implementation.
*/
readonly storageClass: pulumi.Output<string>;
/**
* The storage policy to be used for the
* container. Changing this creates a new container.
*/
readonly storagePolicy: pulumi.Output<string>;
/**
* A boolean that can enable or disable object
* versioning. The default value is `false`. To use this feature, your Swift
* version must be 2.24 or higher (as described in the [OpenStack Swift Ussuri
* release
* notes](https://docs.openstack.org/releasenotes/swift/ussuri.html#relnotes-2-24-0-stable-ussuri)),
* and a cloud administrator must have set the `allowObjectVersioning = true`
* configuration option in Swift. If you cannot set this versioning type, you
* may want to consider using `versioningLegacy` instead.
*/
readonly versioning: pulumi.Output<boolean | undefined>;
/**
* Enable legacy object versioning. The
* structure is described below.
*
* @deprecated Use newer "versioning" implementation
*/
readonly versioningLegacy: pulumi.Output<outputs.objectstorage.ContainerVersioningLegacy | undefined>;
/**
* Create a Container 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?: ContainerArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Container resources.
*/
export interface ContainerState {
/**
* Sets an access control list (ACL) that grants
* read access. This header can contain a comma-delimited list of users that can
* read the container (allows the GET method for all objects in the container).
* Changing this updates the access control list read access.
*/
containerRead?: pulumi.Input<string>;
/**
* The secret key for container
* synchronization. Changing this updates container synchronization.
*/
containerSyncKey?: pulumi.Input<string>;
/**
* The destination for container
* synchronization. Changing this updates container synchronization.
*/
containerSyncTo?: pulumi.Input<string>;
/**
* Sets an ACL that grants write access. Changing
* this updates the access control list write access.
*/
containerWrite?: pulumi.Input<string>;
/**
* The MIME type for the container. Changing this
* updates the MIME type.
*/
contentType?: pulumi.Input<string>;
/**
* A boolean that indicates all
* objects should be deleted from the container so that the container can be
* destroyed without error. These objects are not recoverable.
*/
forceDestroy?: pulumi.Input<boolean>;
/**
* Custom key/value pairs to associate with the
* container. Changing this updates the existing container metadata.
*/
metadata?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* A unique name for the container. Changing this creates a
* new container.
*/
name?: pulumi.Input<string>;
/**
* The region in which to create the container. If
* omitted, the `region` argument of the provider is used. Changing this creates
* a new container.
*/
region?: pulumi.Input<string>;
/**
* The storage class to be used for the container.
* Changing this creates a new container. This option is only available in Ceph
* RGW Swift API implementation.
*/
storageClass?: pulumi.Input<string>;
/**
* The storage policy to be used for the
* container. Changing this creates a new container.
*/
storagePolicy?: pulumi.Input<string>;
/**
* A boolean that can enable or disable object
* versioning. The default value is `false`. To use this feature, your Swift
* version must be 2.24 or higher (as described in the [OpenStack Swift Ussuri
* release
* notes](https://docs.openstack.org/releasenotes/swift/ussuri.html#relnotes-2-24-0-stable-ussuri)),
* and a cloud administrator must have set the `allowObjectVersioning = true`
* configuration option in Swift. If you cannot set this versioning type, you
* may want to consider using `versioningLegacy` instead.
*/
versioning?: pulumi.Input<boolean>;
/**
* Enable legacy object versioning. The
* structure is described below.
*
* @deprecated Use newer "versioning" implementation
*/
versioningLegacy?: pulumi.Input<inputs.objectstorage.ContainerVersioningLegacy>;
}
/**
* The set of arguments for constructing a Container resource.
*/
export interface ContainerArgs {
/**
* Sets an access control list (ACL) that grants
* read access. This header can contain a comma-delimited list of users that can
* read the container (allows the GET method for all objects in the container).
* Changing this updates the access control list read access.
*/
containerRead?: pulumi.Input<string>;
/**
* The secret key for container
* synchronization. Changing this updates container synchronization.
*/
containerSyncKey?: pulumi.Input<string>;
/**
* The destination for container
* synchronization. Changing this updates container synchronization.
*/
containerSyncTo?: pulumi.Input<string>;
/**
* Sets an ACL that grants write access. Changing
* this updates the access control list write access.
*/
containerWrite?: pulumi.Input<string>;
/**
* The MIME type for the container. Changing this
* updates the MIME type.
*/
contentType?: pulumi.Input<string>;
/**
* A boolean that indicates all
* objects should be deleted from the container so that the container can be
* destroyed without error. These objects are not recoverable.
*/
forceDestroy?: pulumi.Input<boolean>;
/**
* Custom key/value pairs to associate with the
* container. Changing this updates the existing container metadata.
*/
metadata?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* A unique name for the container. Changing this creates a
* new container.
*/
name?: pulumi.Input<string>;
/**
* The region in which to create the container. If
* omitted, the `region` argument of the provider is used. Changing this creates
* a new container.
*/
region?: pulumi.Input<string>;
/**
* The storage class to be used for the container.
* Changing this creates a new container. This option is only available in Ceph
* RGW Swift API implementation.
*/
storageClass?: pulumi.Input<string>;
/**
* The storage policy to be used for the
* container. Changing this creates a new container.
*/
storagePolicy?: pulumi.Input<string>;
/**
* A boolean that can enable or disable object
* versioning. The default value is `false`. To use this feature, your Swift
* version must be 2.24 or higher (as described in the [OpenStack Swift Ussuri
* release
* notes](https://docs.openstack.org/releasenotes/swift/ussuri.html#relnotes-2-24-0-stable-ussuri)),
* and a cloud administrator must have set the `allowObjectVersioning = true`
* configuration option in Swift. If you cannot set this versioning type, you
* may want to consider using `versioningLegacy` instead.
*/
versioning?: pulumi.Input<boolean>;
/**
* Enable legacy object versioning. The
* structure is described below.
*
* @deprecated Use newer "versioning" implementation
*/
versioningLegacy?: pulumi.Input<inputs.objectstorage.ContainerVersioningLegacy>;
}