UNPKG

@pulumi/digitalocean

Version:

A Pulumi package for creating and managing DigitalOcean cloud resources.

230 lines (229 loc) • 8.52 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; import * as enums from "./types/enums"; /** * Provides a bucket resource for Spaces, DigitalOcean's object storage product. * * The [Spaces API](https://docs.digitalocean.com/reference/api/spaces-api/) was * designed to be interoperable with Amazon's AWS S3 API. This allows users to * interact with the service while using the tools they already know. Spaces * mirrors S3's authentication framework and requests to Spaces require a key pair * similar to Amazon's Access ID and Secret Key. * * The authentication requirement can be met by either setting the * `SPACES_ACCESS_KEY_ID` and `SPACES_SECRET_ACCESS_KEY` environment variables or * the provider's `spacesAccessId` and `spacesSecretKey` arguments to the * access ID and secret you generate via the DigitalOcean control panel. For * example: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as digitalocean from "@pulumi/digitalocean"; * * const static_assets = new digitalocean.SpacesBucket("static-assets", {}); * ``` * * For more information, See [An Introduction to DigitalOcean Spaces](https://www.digitalocean.com/community/tutorials/an-introduction-to-digitalocean-spaces) * * ## Example Usage * * ### Create a New Bucket * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as digitalocean from "@pulumi/digitalocean"; * * const foobar = new digitalocean.SpacesBucket("foobar", { * name: "foobar", * region: digitalocean.Region.NYC3, * }); * ``` * * ### Create a New Bucket With CORS Rules * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as digitalocean from "@pulumi/digitalocean"; * * const foobar = new digitalocean.SpacesBucket("foobar", { * name: "foobar", * region: digitalocean.Region.NYC3, * corsRules: [ * { * allowedHeaders: ["*"], * allowedMethods: ["GET"], * allowedOrigins: ["*"], * maxAgeSeconds: 3000, * }, * { * allowedHeaders: ["*"], * allowedMethods: [ * "PUT", * "POST", * "DELETE", * ], * allowedOrigins: ["https://www.example.com"], * maxAgeSeconds: 3000, * }, * ], * }); * ``` * * ## Import * * Buckets can be imported using the `region` and `name` attributes (delimited by a comma): * * ```sh * $ pulumi import digitalocean:index/spacesBucket:SpacesBucket foobar `region`,`name` * ``` */ export declare class SpacesBucket extends pulumi.CustomResource { /** * Get an existing SpacesBucket 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?: SpacesBucketState, opts?: pulumi.CustomResourceOptions): SpacesBucket; /** * Returns true if the given object is an instance of SpacesBucket. 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 SpacesBucket; /** * Canned ACL applied on bucket creation: `private` or `public-read` (Defaults to `private`) */ readonly acl: pulumi.Output<string | undefined>; /** * The FQDN of the bucket (e.g. bucket-name.nyc3.digitaloceanspaces.com) */ readonly bucketDomainName: pulumi.Output<string>; /** * The uniform resource name for the bucket */ readonly bucketUrn: pulumi.Output<string>; /** * A rule of Cross-Origin Resource Sharing (documented below). * * @deprecated Terraform will only perform drift detection if a configuration value is provided. Use the resource `digitalocean.SpacesBucketCorsConfiguration` instead. */ readonly corsRules: pulumi.Output<outputs.SpacesBucketCorsRule[] | undefined>; /** * The FQDN of the bucket without the bucket name (e.g. nyc3.digitaloceanspaces.com) */ readonly endpoint: pulumi.Output<string>; /** * Unless `true`, the bucket will only be destroyed if empty (Defaults to `false`) */ readonly forceDestroy: pulumi.Output<boolean | undefined>; /** * A configuration of object lifecycle management (documented below). */ readonly lifecycleRules: pulumi.Output<outputs.SpacesBucketLifecycleRule[] | undefined>; /** * The name of the bucket */ readonly name: pulumi.Output<string>; /** * The region where the bucket resides (Defaults to `nyc3`) */ readonly region: pulumi.Output<string | undefined>; /** * A state of versioning (documented below) */ readonly versioning: pulumi.Output<outputs.SpacesBucketVersioning | undefined>; /** * Create a SpacesBucket 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?: SpacesBucketArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering SpacesBucket resources. */ export interface SpacesBucketState { /** * Canned ACL applied on bucket creation: `private` or `public-read` (Defaults to `private`) */ acl?: pulumi.Input<string>; /** * The FQDN of the bucket (e.g. bucket-name.nyc3.digitaloceanspaces.com) */ bucketDomainName?: pulumi.Input<string>; /** * The uniform resource name for the bucket */ bucketUrn?: pulumi.Input<string>; /** * A rule of Cross-Origin Resource Sharing (documented below). * * @deprecated Terraform will only perform drift detection if a configuration value is provided. Use the resource `digitalocean.SpacesBucketCorsConfiguration` instead. */ corsRules?: pulumi.Input<pulumi.Input<inputs.SpacesBucketCorsRule>[]>; /** * The FQDN of the bucket without the bucket name (e.g. nyc3.digitaloceanspaces.com) */ endpoint?: pulumi.Input<string>; /** * Unless `true`, the bucket will only be destroyed if empty (Defaults to `false`) */ forceDestroy?: pulumi.Input<boolean>; /** * A configuration of object lifecycle management (documented below). */ lifecycleRules?: pulumi.Input<pulumi.Input<inputs.SpacesBucketLifecycleRule>[]>; /** * The name of the bucket */ name?: pulumi.Input<string>; /** * The region where the bucket resides (Defaults to `nyc3`) */ region?: pulumi.Input<string | enums.Region>; /** * A state of versioning (documented below) */ versioning?: pulumi.Input<inputs.SpacesBucketVersioning>; } /** * The set of arguments for constructing a SpacesBucket resource. */ export interface SpacesBucketArgs { /** * Canned ACL applied on bucket creation: `private` or `public-read` (Defaults to `private`) */ acl?: pulumi.Input<string>; /** * A rule of Cross-Origin Resource Sharing (documented below). * * @deprecated Terraform will only perform drift detection if a configuration value is provided. Use the resource `digitalocean.SpacesBucketCorsConfiguration` instead. */ corsRules?: pulumi.Input<pulumi.Input<inputs.SpacesBucketCorsRule>[]>; /** * Unless `true`, the bucket will only be destroyed if empty (Defaults to `false`) */ forceDestroy?: pulumi.Input<boolean>; /** * A configuration of object lifecycle management (documented below). */ lifecycleRules?: pulumi.Input<pulumi.Input<inputs.SpacesBucketLifecycleRule>[]>; /** * The name of the bucket */ name?: pulumi.Input<string>; /** * The region where the bucket resides (Defaults to `nyc3`) */ region?: pulumi.Input<string | enums.Region>; /** * A state of versioning (documented below) */ versioning?: pulumi.Input<inputs.SpacesBucketVersioning>; }