All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.digitalocean.kotlin.SpacesBucketObjectArgs.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.digitalocean.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.digitalocean.SpacesBucketObjectArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Boolean
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Provides a bucket object resource for Spaces, DigitalOcean's object storage product.
 * The `digitalocean.SpacesBucketObject` resource allows the provider to upload content
 * to Spaces.
 * 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 `spaces_access_id` and `spaces_secret_key` 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", {});
 * ```
 * ```python
 * import pulumi
 * import pulumi_digitalocean as digitalocean
 * static_assets = digitalocean.SpacesBucket("static-assets")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using DigitalOcean = Pulumi.DigitalOcean;
 * return await Deployment.RunAsync(() =>
 * {
 *     var static_assets = new DigitalOcean.SpacesBucket("static-assets");
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := digitalocean.NewSpacesBucket(ctx, "static-assets", nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.digitalocean.SpacesBucket;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 *     public static void stack(Context ctx) {
 *         var static_assets = new SpacesBucket("static-assets");
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   static-assets:
 *     type: digitalocean:SpacesBucket
 * ```
 * 
 * For more information, See [An Introduction to DigitalOcean Spaces](https://www.digitalocean.com/community/tutorials/an-introduction-to-digitalocean-spaces)
 * ## Example Usage
 * ### Create a Key in a Spaces 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,
 * });
 * const index = new digitalocean.SpacesBucketObject("index", {
 *     region: foobar.region,
 *     bucket: foobar.name,
 *     key: "index.html",
 *     content: "

This page is empty.

", * contentType: "text/html", * }); * ``` * ```python * import pulumi * import pulumi_digitalocean as digitalocean * foobar = digitalocean.SpacesBucket("foobar", * name="foobar", * region=digitalocean.Region.NYC3) * index = digitalocean.SpacesBucketObject("index", * region=foobar.region, * bucket=foobar.name, * key="index.html", * content="

This page is empty.

", * content_type="text/html") * ``` * ```csharp * using System.Collections.Generic; * using System.Linq; * using Pulumi; * using DigitalOcean = Pulumi.DigitalOcean; * return await Deployment.RunAsync(() => * { * var foobar = new DigitalOcean.SpacesBucket("foobar", new() * { * Name = "foobar", * Region = DigitalOcean.Region.NYC3, * }); * var index = new DigitalOcean.SpacesBucketObject("index", new() * { * Region = foobar.Region, * Bucket = foobar.Name, * Key = "index.html", * Content = "

This page is empty.

", * ContentType = "text/html", * }); * }); * ``` * ```go * package main * import ( * "github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean" * "github.com/pulumi/pulumi/sdk/v3/go/pulumi" * ) * func main() { * pulumi.Run(func(ctx *pulumi.Context) error { * foobar, err := digitalocean.NewSpacesBucket(ctx, "foobar", &digitalocean.SpacesBucketArgs{ * Name: pulumi.String("foobar"), * Region: pulumi.String(digitalocean.RegionNYC3), * }) * if err != nil { * return err * } * _, err = digitalocean.NewSpacesBucketObject(ctx, "index", &digitalocean.SpacesBucketObjectArgs{ * Region: foobar.Region, * Bucket: foobar.Name, * Key: pulumi.String("index.html"), * Content: pulumi.String("

This page is empty.

"), * ContentType: pulumi.String("text/html"), * }) * if err != nil { * return err * } * return nil * }) * } * ``` * ```java * package generated_program; * import com.pulumi.Context; * import com.pulumi.Pulumi; * import com.pulumi.core.Output; * import com.pulumi.digitalocean.SpacesBucket; * import com.pulumi.digitalocean.SpacesBucketArgs; * import com.pulumi.digitalocean.SpacesBucketObject; * import com.pulumi.digitalocean.SpacesBucketObjectArgs; * import java.util.List; * import java.util.ArrayList; * import java.util.Map; * import java.io.File; * import java.nio.file.Files; * import java.nio.file.Paths; * public class App { * public static void main(String[] args) { * Pulumi.run(App::stack); * } * public static void stack(Context ctx) { * var foobar = new SpacesBucket("foobar", SpacesBucketArgs.builder() * .name("foobar") * .region("nyc3") * .build()); * var index = new SpacesBucketObject("index", SpacesBucketObjectArgs.builder() * .region(foobar.region()) * .bucket(foobar.name()) * .key("index.html") * .content("

This page is empty.

") * .contentType("text/html") * .build()); * } * } * ``` * ```yaml * resources: * foobar: * type: digitalocean:SpacesBucket * properties: * name: foobar * region: nyc3 * index: * type: digitalocean:SpacesBucketObject * properties: * region: ${foobar.region} * bucket: ${foobar.name} * key: index.html * content:

This page is empty.

* contentType: text/html * ``` * * ## Import * Importing this resource is not supported. * @property acl The canned ACL to apply. DigitalOcean supports "private" and "public-read". (Defaults to "private".) * @property bucket The name of the bucket to put the file in. * @property cacheControl Specifies caching behavior along the request/reply chain Read [w3c cache_control](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9) for further details. * @property content Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text. * @property contentBase64 Base64-encoded data that will be decoded and uploaded as raw bytes for the object content. This allows safely uploading non-UTF8 binary data, but is recommended only for small content such as the result of the `gzipbase64` function with small text strings. For larger objects, use `source` to stream the content from a disk file. * @property contentDisposition Specifies presentational information for the object. Read [w3c content_disposition](http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1) for further information. * @property contentEncoding Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field. Read [w3c content encoding](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11) for further information. * @property contentLanguage The language the content is in e.g. en-US or en-GB. * @property contentType A standard MIME type describing the format of the object data, e.g. application/octet-stream. All Valid MIME Types are valid for this input. * @property etag Used to trigger updates. * @property forceDestroy Allow the object to be deleted by removing any legal hold on any object version. * Default is `false`. This value should be set to `true` only if the bucket has S3 object lock enabled. * If no content is provided through `source`, `content` or `content_base64`, then the object will be empty. * > **Note:** The provider ignores all leading `/`s in the object's `key` and treats multiple `/`s in the rest of the object's `key` as a single `/`, so values of `/index.html` and `index.html` correspond to the same S3 object as do `first//second///third//` and `first/second/third/`. * @property key The name of the object once it is in the bucket. * @property metadata A mapping of keys/values to provision metadata (will be automatically prefixed by `x-amz-meta-`, note that only lowercase label are currently supported by the AWS Go API). * @property region The region where the bucket resides (Defaults to `nyc3`) * @property source The path to a file that will be read and uploaded as raw bytes for the object content. * @property websiteRedirect Specifies a target URL for [website redirect](http://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html). */ public data class SpacesBucketObjectArgs( public val acl: Output? = null, public val bucket: Output? = null, public val cacheControl: Output? = null, public val content: Output? = null, public val contentBase64: Output? = null, public val contentDisposition: Output? = null, public val contentEncoding: Output? = null, public val contentLanguage: Output? = null, public val contentType: Output? = null, public val etag: Output? = null, public val forceDestroy: Output? = null, public val key: Output? = null, public val metadata: Output>? = null, public val region: Output? = null, public val source: Output? = null, public val websiteRedirect: Output? = null, ) : ConvertibleToJava { override fun toJava(): com.pulumi.digitalocean.SpacesBucketObjectArgs = com.pulumi.digitalocean.SpacesBucketObjectArgs.builder() .acl(acl?.applyValue({ args0 -> args0 })) .bucket(bucket?.applyValue({ args0 -> args0 })) .cacheControl(cacheControl?.applyValue({ args0 -> args0 })) .content(content?.applyValue({ args0 -> args0 })) .contentBase64(contentBase64?.applyValue({ args0 -> args0 })) .contentDisposition(contentDisposition?.applyValue({ args0 -> args0 })) .contentEncoding(contentEncoding?.applyValue({ args0 -> args0 })) .contentLanguage(contentLanguage?.applyValue({ args0 -> args0 })) .contentType(contentType?.applyValue({ args0 -> args0 })) .etag(etag?.applyValue({ args0 -> args0 })) .forceDestroy(forceDestroy?.applyValue({ args0 -> args0 })) .key(key?.applyValue({ args0 -> args0 })) .metadata( metadata?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }), ) .region(region?.applyValue({ args0 -> args0 })) .source(source?.applyValue({ args0 -> args0 })) .websiteRedirect(websiteRedirect?.applyValue({ args0 -> args0 })).build() } /** * Builder for [SpacesBucketObjectArgs]. */ @PulumiTagMarker public class SpacesBucketObjectArgsBuilder internal constructor() { private var acl: Output? = null private var bucket: Output? = null private var cacheControl: Output? = null private var content: Output? = null private var contentBase64: Output? = null private var contentDisposition: Output? = null private var contentEncoding: Output? = null private var contentLanguage: Output? = null private var contentType: Output? = null private var etag: Output? = null private var forceDestroy: Output? = null private var key: Output? = null private var metadata: Output>? = null private var region: Output? = null private var source: Output? = null private var websiteRedirect: Output? = null /** * @param value The canned ACL to apply. DigitalOcean supports "private" and "public-read". (Defaults to "private".) */ @JvmName("oebgjivmdsgbaovn") public suspend fun acl(`value`: Output) { this.acl = value } /** * @param value The name of the bucket to put the file in. */ @JvmName("gqfnspacdkytoigc") public suspend fun bucket(`value`: Output) { this.bucket = value } /** * @param value Specifies caching behavior along the request/reply chain Read [w3c cache_control](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9) for further details. */ @JvmName("ycuyfxqdneovasrm") public suspend fun cacheControl(`value`: Output) { this.cacheControl = value } /** * @param value Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text. */ @JvmName("essajwaofusxvxec") public suspend fun content(`value`: Output) { this.content = value } /** * @param value Base64-encoded data that will be decoded and uploaded as raw bytes for the object content. This allows safely uploading non-UTF8 binary data, but is recommended only for small content such as the result of the `gzipbase64` function with small text strings. For larger objects, use `source` to stream the content from a disk file. */ @JvmName("apfejuynhabofyha") public suspend fun contentBase64(`value`: Output) { this.contentBase64 = value } /** * @param value Specifies presentational information for the object. Read [w3c content_disposition](http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1) for further information. */ @JvmName("mdwoqushyqgsjobg") public suspend fun contentDisposition(`value`: Output) { this.contentDisposition = value } /** * @param value Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field. Read [w3c content encoding](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11) for further information. */ @JvmName("jrupdaxvsuposiml") public suspend fun contentEncoding(`value`: Output) { this.contentEncoding = value } /** * @param value The language the content is in e.g. en-US or en-GB. */ @JvmName("rqhyrpmepttyssrb") public suspend fun contentLanguage(`value`: Output) { this.contentLanguage = value } /** * @param value A standard MIME type describing the format of the object data, e.g. application/octet-stream. All Valid MIME Types are valid for this input. */ @JvmName("gnjjrohkhvqihijp") public suspend fun contentType(`value`: Output) { this.contentType = value } /** * @param value Used to trigger updates. */ @JvmName("upkdbiwigsoxicrs") public suspend fun etag(`value`: Output) { this.etag = value } /** * @param value Allow the object to be deleted by removing any legal hold on any object version. * Default is `false`. This value should be set to `true` only if the bucket has S3 object lock enabled. * If no content is provided through `source`, `content` or `content_base64`, then the object will be empty. * > **Note:** The provider ignores all leading `/`s in the object's `key` and treats multiple `/`s in the rest of the object's `key` as a single `/`, so values of `/index.html` and `index.html` correspond to the same S3 object as do `first//second///third//` and `first/second/third/`. */ @JvmName("xscuioeuydtadyte") public suspend fun forceDestroy(`value`: Output) { this.forceDestroy = value } /** * @param value The name of the object once it is in the bucket. */ @JvmName("myvcdvlhvfurgfhp") public suspend fun key(`value`: Output) { this.key = value } /** * @param value A mapping of keys/values to provision metadata (will be automatically prefixed by `x-amz-meta-`, note that only lowercase label are currently supported by the AWS Go API). */ @JvmName("mcywxlueohwakdmn") public suspend fun metadata(`value`: Output>) { this.metadata = value } /** * @param value The region where the bucket resides (Defaults to `nyc3`) */ @JvmName("iucpoiybdkxjpqjw") public suspend fun region(`value`: Output) { this.region = value } /** * @param value The path to a file that will be read and uploaded as raw bytes for the object content. */ @JvmName("jmudckuntbhnfnba") public suspend fun source(`value`: Output) { this.source = value } /** * @param value Specifies a target URL for [website redirect](http://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html). */ @JvmName("imkmfdxvhssyrybo") public suspend fun websiteRedirect(`value`: Output) { this.websiteRedirect = value } /** * @param value The canned ACL to apply. DigitalOcean supports "private" and "public-read". (Defaults to "private".) */ @JvmName("tdimuriqpyywerev") public suspend fun acl(`value`: String?) { val toBeMapped = value val mapped = toBeMapped?.let({ args0 -> of(args0) }) this.acl = mapped } /** * @param value The name of the bucket to put the file in. */ @JvmName("bqejqshshawyhdtp") public suspend fun bucket(`value`: String?) { val toBeMapped = value val mapped = toBeMapped?.let({ args0 -> of(args0) }) this.bucket = mapped } /** * @param value Specifies caching behavior along the request/reply chain Read [w3c cache_control](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9) for further details. */ @JvmName("wasctpmsnokwclwd") public suspend fun cacheControl(`value`: String?) { val toBeMapped = value val mapped = toBeMapped?.let({ args0 -> of(args0) }) this.cacheControl = mapped } /** * @param value Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text. */ @JvmName("hhellwetamorrvsm") public suspend fun content(`value`: String?) { val toBeMapped = value val mapped = toBeMapped?.let({ args0 -> of(args0) }) this.content = mapped } /** * @param value Base64-encoded data that will be decoded and uploaded as raw bytes for the object content. This allows safely uploading non-UTF8 binary data, but is recommended only for small content such as the result of the `gzipbase64` function with small text strings. For larger objects, use `source` to stream the content from a disk file. */ @JvmName("xdhnegyrvyqeoflt") public suspend fun contentBase64(`value`: String?) { val toBeMapped = value val mapped = toBeMapped?.let({ args0 -> of(args0) }) this.contentBase64 = mapped } /** * @param value Specifies presentational information for the object. Read [w3c content_disposition](http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1) for further information. */ @JvmName("vqaeqwpdgnqodrwb") public suspend fun contentDisposition(`value`: String?) { val toBeMapped = value val mapped = toBeMapped?.let({ args0 -> of(args0) }) this.contentDisposition = mapped } /** * @param value Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field. Read [w3c content encoding](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11) for further information. */ @JvmName("bsigqxkovavruauj") public suspend fun contentEncoding(`value`: String?) { val toBeMapped = value val mapped = toBeMapped?.let({ args0 -> of(args0) }) this.contentEncoding = mapped } /** * @param value The language the content is in e.g. en-US or en-GB. */ @JvmName("smcuyydlgevdpqhp") public suspend fun contentLanguage(`value`: String?) { val toBeMapped = value val mapped = toBeMapped?.let({ args0 -> of(args0) }) this.contentLanguage = mapped } /** * @param value A standard MIME type describing the format of the object data, e.g. application/octet-stream. All Valid MIME Types are valid for this input. */ @JvmName("fnxnourtyswttrat") public suspend fun contentType(`value`: String?) { val toBeMapped = value val mapped = toBeMapped?.let({ args0 -> of(args0) }) this.contentType = mapped } /** * @param value Used to trigger updates. */ @JvmName("euuncthgiusdpcgn") public suspend fun etag(`value`: String?) { val toBeMapped = value val mapped = toBeMapped?.let({ args0 -> of(args0) }) this.etag = mapped } /** * @param value Allow the object to be deleted by removing any legal hold on any object version. * Default is `false`. This value should be set to `true` only if the bucket has S3 object lock enabled. * If no content is provided through `source`, `content` or `content_base64`, then the object will be empty. * > **Note:** The provider ignores all leading `/`s in the object's `key` and treats multiple `/`s in the rest of the object's `key` as a single `/`, so values of `/index.html` and `index.html` correspond to the same S3 object as do `first//second///third//` and `first/second/third/`. */ @JvmName("joeoedxhpkwixivd") public suspend fun forceDestroy(`value`: Boolean?) { val toBeMapped = value val mapped = toBeMapped?.let({ args0 -> of(args0) }) this.forceDestroy = mapped } /** * @param value The name of the object once it is in the bucket. */ @JvmName("qwtuynraqmhtajkt") public suspend fun key(`value`: String?) { val toBeMapped = value val mapped = toBeMapped?.let({ args0 -> of(args0) }) this.key = mapped } /** * @param value A mapping of keys/values to provision metadata (will be automatically prefixed by `x-amz-meta-`, note that only lowercase label are currently supported by the AWS Go API). */ @JvmName("kjggbktyxalxwyyj") public suspend fun metadata(`value`: Map?) { val toBeMapped = value val mapped = toBeMapped?.let({ args0 -> of(args0) }) this.metadata = mapped } /** * @param values A mapping of keys/values to provision metadata (will be automatically prefixed by `x-amz-meta-`, note that only lowercase label are currently supported by the AWS Go API). */ @JvmName("vnicxcybamxdlamq") public fun metadata(vararg values: Pair) { val toBeMapped = values.toMap() val mapped = toBeMapped.let({ args0 -> of(args0) }) this.metadata = mapped } /** * @param value The region where the bucket resides (Defaults to `nyc3`) */ @JvmName("nvufphvcmorrwxqe") public suspend fun region(`value`: String?) { val toBeMapped = value val mapped = toBeMapped?.let({ args0 -> of(args0) }) this.region = mapped } /** * @param value The path to a file that will be read and uploaded as raw bytes for the object content. */ @JvmName("dvjmvxlxsmaihfdw") public suspend fun source(`value`: String?) { val toBeMapped = value val mapped = toBeMapped?.let({ args0 -> of(args0) }) this.source = mapped } /** * @param value Specifies a target URL for [website redirect](http://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html). */ @JvmName("ltojmsvhkyifvupq") public suspend fun websiteRedirect(`value`: String?) { val toBeMapped = value val mapped = toBeMapped?.let({ args0 -> of(args0) }) this.websiteRedirect = mapped } internal fun build(): SpacesBucketObjectArgs = SpacesBucketObjectArgs( acl = acl, bucket = bucket, cacheControl = cacheControl, content = content, contentBase64 = contentBase64, contentDisposition = contentDisposition, contentEncoding = contentEncoding, contentLanguage = contentLanguage, contentType = contentType, etag = etag, forceDestroy = forceDestroy, key = key, metadata = metadata, region = region, source = source, websiteRedirect = websiteRedirect, ) }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy