SpacesBucketObjectArgs

data class SpacesBucketObjectArgs(val acl: Output<String>? = null, val bucket: Output<String>? = null, val cacheControl: Output<String>? = null, val content: Output<String>? = null, val contentBase64: Output<String>? = null, val contentDisposition: Output<String>? = null, val contentEncoding: Output<String>? = null, val contentLanguage: Output<String>? = null, val contentType: Output<String>? = null, val etag: Output<String>? = null, val forceDestroy: Output<Boolean>? = null, val key: Output<String>? = null, val metadata: Output<Map<String, String>>? = null, val region: Output<String>? = null, val source: Output<String>? = null, val websiteRedirect: Output<String>? = null) : ConvertibleToJava<SpacesBucketObjectArgs>

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 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:

import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";
const static_assets = new digitalocean.SpacesBucket("static-assets", {});
import pulumi
import pulumi_digitalocean as digitalocean
static_assets = digitalocean.SpacesBucket("static-assets")
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");
});
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
})
}
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");
}
}
resources:
static-assets:
type: digitalocean:SpacesBucket

For more information, See An Introduction to DigitalOcean Spaces

Example Usage

Create a Key in a Spaces Bucket

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: "<html><body><p>This page is empty.</p></body></html>",
contentType: "text/html",
});
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="<html><body><p>This page is empty.</p></body></html>",
content_type="text/html")
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 = "<html><body><p>This page is empty.</p></body></html>",
ContentType = "text/html",
});
});
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("<html><body><p>This page is empty.</p></body></html>"),
ContentType: pulumi.String("text/html"),
})
if err != nil {
return err
}
return nil
})
}
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("<html><body><p>This page is empty.</p></body></html>")
.contentType("text/html")
.build());
}
}
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: <html><body><p>This page is empty.</p></body></html>
contentType: text/html

Import

Importing this resource is not supported.

Constructors

Link copied to clipboard
constructor(acl: Output<String>? = null, bucket: Output<String>? = null, cacheControl: Output<String>? = null, content: Output<String>? = null, contentBase64: Output<String>? = null, contentDisposition: Output<String>? = null, contentEncoding: Output<String>? = null, contentLanguage: Output<String>? = null, contentType: Output<String>? = null, etag: Output<String>? = null, forceDestroy: Output<Boolean>? = null, key: Output<String>? = null, metadata: Output<Map<String, String>>? = null, region: Output<String>? = null, source: Output<String>? = null, websiteRedirect: Output<String>? = null)

Properties

Link copied to clipboard
val acl: Output<String>? = null

The canned ACL to apply. DigitalOcean supports "private" and "public-read". (Defaults to "private".)

Link copied to clipboard
val bucket: Output<String>? = null

The name of the bucket to put the file in.

Link copied to clipboard
val cacheControl: Output<String>? = null

Specifies caching behavior along the request/reply chain Read w3c cache_control for further details.

Link copied to clipboard
val content: Output<String>? = null

Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text.

Link copied to clipboard
val contentBase64: Output<String>? = null

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.

Link copied to clipboard
val contentDisposition: Output<String>? = null

Specifies presentational information for the object. Read w3c content_disposition for further information.

Link copied to clipboard
val contentEncoding: Output<String>? = null

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 for further information.

Link copied to clipboard
val contentLanguage: Output<String>? = null

The language the content is in e.g. en-US or en-GB.

Link copied to clipboard
val contentType: Output<String>? = null

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.

Link copied to clipboard
val etag: Output<String>? = null

Used to trigger updates.

Link copied to clipboard
val forceDestroy: Output<Boolean>? = null

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.

Link copied to clipboard
val key: Output<String>? = null

The name of the object once it is in the bucket.

Link copied to clipboard
val metadata: Output<Map<String, String>>? = null

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).

Link copied to clipboard
val region: Output<String>? = null

The region where the bucket resides (Defaults to nyc3)

Link copied to clipboard
val source: Output<String>? = null

The path to a file that will be read and uploaded as raw bytes for the object content.

Link copied to clipboard
val websiteRedirect: Output<String>? = null

Specifies a target URL for website redirect.

Functions

Link copied to clipboard
open override fun toJava(): SpacesBucketObjectArgs