digitalocean.SpacesBucketObject
Explore with Pulumi AI
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")
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
})
}
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 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")
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
})
}
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 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
Create SpacesBucketObject Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new SpacesBucketObject(name: string, args: SpacesBucketObjectArgs, opts?: CustomResourceOptions);
@overload
def SpacesBucketObject(resource_name: str,
args: SpacesBucketObjectArgs,
opts: Optional[ResourceOptions] = None)
@overload
def SpacesBucketObject(resource_name: str,
opts: Optional[ResourceOptions] = None,
key: Optional[str] = None,
bucket: Optional[str] = None,
region: Optional[str] = None,
content_type: Optional[str] = None,
content_base64: Optional[str] = None,
content_disposition: Optional[str] = None,
content_encoding: Optional[str] = None,
content_language: Optional[str] = None,
acl: Optional[str] = None,
etag: Optional[str] = None,
force_destroy: Optional[bool] = None,
content: Optional[str] = None,
metadata: Optional[Mapping[str, str]] = None,
cache_control: Optional[str] = None,
source: Optional[str] = None,
website_redirect: Optional[str] = None)
func NewSpacesBucketObject(ctx *Context, name string, args SpacesBucketObjectArgs, opts ...ResourceOption) (*SpacesBucketObject, error)
public SpacesBucketObject(string name, SpacesBucketObjectArgs args, CustomResourceOptions? opts = null)
public SpacesBucketObject(String name, SpacesBucketObjectArgs args)
public SpacesBucketObject(String name, SpacesBucketObjectArgs args, CustomResourceOptions options)
type: digitalocean:SpacesBucketObject
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args SpacesBucketObjectArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args SpacesBucketObjectArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args SpacesBucketObjectArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SpacesBucketObjectArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args SpacesBucketObjectArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var spacesBucketObjectResource = new DigitalOcean.SpacesBucketObject("spacesBucketObjectResource", new()
{
Key = "string",
Bucket = "string",
Region = "string",
ContentType = "string",
ContentBase64 = "string",
ContentDisposition = "string",
ContentEncoding = "string",
ContentLanguage = "string",
Acl = "string",
Etag = "string",
ForceDestroy = false,
Content = "string",
Metadata =
{
{ "string", "string" },
},
CacheControl = "string",
Source = "string",
WebsiteRedirect = "string",
});
example, err := digitalocean.NewSpacesBucketObject(ctx, "spacesBucketObjectResource", &digitalocean.SpacesBucketObjectArgs{
Key: pulumi.String("string"),
Bucket: pulumi.String("string"),
Region: pulumi.String("string"),
ContentType: pulumi.String("string"),
ContentBase64: pulumi.String("string"),
ContentDisposition: pulumi.String("string"),
ContentEncoding: pulumi.String("string"),
ContentLanguage: pulumi.String("string"),
Acl: pulumi.String("string"),
Etag: pulumi.String("string"),
ForceDestroy: pulumi.Bool(false),
Content: pulumi.String("string"),
Metadata: pulumi.StringMap{
"string": pulumi.String("string"),
},
CacheControl: pulumi.String("string"),
Source: pulumi.String("string"),
WebsiteRedirect: pulumi.String("string"),
})
var spacesBucketObjectResource = new SpacesBucketObject("spacesBucketObjectResource", SpacesBucketObjectArgs.builder()
.key("string")
.bucket("string")
.region("string")
.contentType("string")
.contentBase64("string")
.contentDisposition("string")
.contentEncoding("string")
.contentLanguage("string")
.acl("string")
.etag("string")
.forceDestroy(false)
.content("string")
.metadata(Map.of("string", "string"))
.cacheControl("string")
.source("string")
.websiteRedirect("string")
.build());
spaces_bucket_object_resource = digitalocean.SpacesBucketObject("spacesBucketObjectResource",
key="string",
bucket="string",
region="string",
content_type="string",
content_base64="string",
content_disposition="string",
content_encoding="string",
content_language="string",
acl="string",
etag="string",
force_destroy=False,
content="string",
metadata={
"string": "string",
},
cache_control="string",
source="string",
website_redirect="string")
const spacesBucketObjectResource = new digitalocean.SpacesBucketObject("spacesBucketObjectResource", {
key: "string",
bucket: "string",
region: "string",
contentType: "string",
contentBase64: "string",
contentDisposition: "string",
contentEncoding: "string",
contentLanguage: "string",
acl: "string",
etag: "string",
forceDestroy: false,
content: "string",
metadata: {
string: "string",
},
cacheControl: "string",
source: "string",
websiteRedirect: "string",
});
type: digitalocean:SpacesBucketObject
properties:
acl: string
bucket: string
cacheControl: string
content: string
contentBase64: string
contentDisposition: string
contentEncoding: string
contentLanguage: string
contentType: string
etag: string
forceDestroy: false
key: string
metadata:
string: string
region: string
source: string
websiteRedirect: string
SpacesBucketObject Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The SpacesBucketObject resource accepts the following input properties:
- Bucket string
- The name of the bucket to put the file in.
- Key string
- The name of the object once it is in the bucket.
- Region string
- The region where the bucket resides (Defaults to
nyc3
) - Acl string
- The canned ACL to apply. DigitalOcean supports "private" and "public-read". (Defaults to "private".)
- Cache
Control string - Specifies caching behavior along the request/reply chain Read w3c cache_control for further details.
- Content string
- Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text.
- Content
Base64 string - 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, usesource
to stream the content from a disk file. - Content
Disposition string - Specifies presentational information for the object. Read w3c content_disposition for further information.
- Content
Encoding string - 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.
- Content
Language string - The language the content is in e.g. en-US or en-GB.
- Content
Type string - 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.
- Etag string
- Used to trigger updates.
- Force
Destroy bool Allow the object to be deleted by removing any legal hold on any object version. Default is
false
. This value should be set totrue
only if the bucket has S3 object lock enabled.If no content is provided through
source
,content
orcontent_base64
, then the object will be empty.Note: The provider ignores all leading
/
s in the object'skey
and treats multiple/
s in the rest of the object'skey
as a single/
, so values of/index.html
andindex.html
correspond to the same S3 object as dofirst//second///third//
andfirst/second/third/
.- Metadata Dictionary<string, string>
- 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). - Source string
- The path to a file that will be read and uploaded as raw bytes for the object content.
- Website
Redirect string - Specifies a target URL for website redirect.
- Bucket string
- The name of the bucket to put the file in.
- Key string
- The name of the object once it is in the bucket.
- Region string
- The region where the bucket resides (Defaults to
nyc3
) - Acl string
- The canned ACL to apply. DigitalOcean supports "private" and "public-read". (Defaults to "private".)
- Cache
Control string - Specifies caching behavior along the request/reply chain Read w3c cache_control for further details.
- Content string
- Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text.
- Content
Base64 string - 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, usesource
to stream the content from a disk file. - Content
Disposition string - Specifies presentational information for the object. Read w3c content_disposition for further information.
- Content
Encoding string - 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.
- Content
Language string - The language the content is in e.g. en-US or en-GB.
- Content
Type string - 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.
- Etag string
- Used to trigger updates.
- Force
Destroy bool Allow the object to be deleted by removing any legal hold on any object version. Default is
false
. This value should be set totrue
only if the bucket has S3 object lock enabled.If no content is provided through
source
,content
orcontent_base64
, then the object will be empty.Note: The provider ignores all leading
/
s in the object'skey
and treats multiple/
s in the rest of the object'skey
as a single/
, so values of/index.html
andindex.html
correspond to the same S3 object as dofirst//second///third//
andfirst/second/third/
.- Metadata map[string]string
- 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). - Source string
- The path to a file that will be read and uploaded as raw bytes for the object content.
- Website
Redirect string - Specifies a target URL for website redirect.
- bucket String
- The name of the bucket to put the file in.
- key String
- The name of the object once it is in the bucket.
- region String
- The region where the bucket resides (Defaults to
nyc3
) - acl String
- The canned ACL to apply. DigitalOcean supports "private" and "public-read". (Defaults to "private".)
- cache
Control String - Specifies caching behavior along the request/reply chain Read w3c cache_control for further details.
- content String
- Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text.
- content
Base64 String - 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, usesource
to stream the content from a disk file. - content
Disposition String - Specifies presentational information for the object. Read w3c content_disposition for further information.
- content
Encoding String - 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.
- content
Language String - The language the content is in e.g. en-US or en-GB.
- content
Type String - 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.
- etag String
- Used to trigger updates.
- force
Destroy Boolean Allow the object to be deleted by removing any legal hold on any object version. Default is
false
. This value should be set totrue
only if the bucket has S3 object lock enabled.If no content is provided through
source
,content
orcontent_base64
, then the object will be empty.Note: The provider ignores all leading
/
s in the object'skey
and treats multiple/
s in the rest of the object'skey
as a single/
, so values of/index.html
andindex.html
correspond to the same S3 object as dofirst//second///third//
andfirst/second/third/
.- metadata Map<String,String>
- 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). - source String
- The path to a file that will be read and uploaded as raw bytes for the object content.
- website
Redirect String - Specifies a target URL for website redirect.
- bucket string
- The name of the bucket to put the file in.
- key string
- The name of the object once it is in the bucket.
- region string
- The region where the bucket resides (Defaults to
nyc3
) - acl string
- The canned ACL to apply. DigitalOcean supports "private" and "public-read". (Defaults to "private".)
- cache
Control string - Specifies caching behavior along the request/reply chain Read w3c cache_control for further details.
- content string
- Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text.
- content
Base64 string - 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, usesource
to stream the content from a disk file. - content
Disposition string - Specifies presentational information for the object. Read w3c content_disposition for further information.
- content
Encoding string - 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.
- content
Language string - The language the content is in e.g. en-US or en-GB.
- content
Type string - 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.
- etag string
- Used to trigger updates.
- force
Destroy boolean Allow the object to be deleted by removing any legal hold on any object version. Default is
false
. This value should be set totrue
only if the bucket has S3 object lock enabled.If no content is provided through
source
,content
orcontent_base64
, then the object will be empty.Note: The provider ignores all leading
/
s in the object'skey
and treats multiple/
s in the rest of the object'skey
as a single/
, so values of/index.html
andindex.html
correspond to the same S3 object as dofirst//second///third//
andfirst/second/third/
.- metadata {[key: string]: string}
- 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). - source string
- The path to a file that will be read and uploaded as raw bytes for the object content.
- website
Redirect string - Specifies a target URL for website redirect.
- bucket str
- The name of the bucket to put the file in.
- key str
- The name of the object once it is in the bucket.
- region str
- The region where the bucket resides (Defaults to
nyc3
) - acl str
- The canned ACL to apply. DigitalOcean supports "private" and "public-read". (Defaults to "private".)
- cache_
control str - Specifies caching behavior along the request/reply chain Read w3c cache_control for further details.
- content str
- Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text.
- content_
base64 str - 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, usesource
to stream the content from a disk file. - content_
disposition str - Specifies presentational information for the object. Read w3c content_disposition for further information.
- content_
encoding str - 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.
- content_
language str - The language the content is in e.g. en-US or en-GB.
- content_
type str - 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.
- etag str
- Used to trigger updates.
- force_
destroy bool Allow the object to be deleted by removing any legal hold on any object version. Default is
false
. This value should be set totrue
only if the bucket has S3 object lock enabled.If no content is provided through
source
,content
orcontent_base64
, then the object will be empty.Note: The provider ignores all leading
/
s in the object'skey
and treats multiple/
s in the rest of the object'skey
as a single/
, so values of/index.html
andindex.html
correspond to the same S3 object as dofirst//second///third//
andfirst/second/third/
.- metadata Mapping[str, str]
- 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). - source str
- The path to a file that will be read and uploaded as raw bytes for the object content.
- website_
redirect str - Specifies a target URL for website redirect.
- bucket String
- The name of the bucket to put the file in.
- key String
- The name of the object once it is in the bucket.
- region String
- The region where the bucket resides (Defaults to
nyc3
) - acl String
- The canned ACL to apply. DigitalOcean supports "private" and "public-read". (Defaults to "private".)
- cache
Control String - Specifies caching behavior along the request/reply chain Read w3c cache_control for further details.
- content String
- Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text.
- content
Base64 String - 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, usesource
to stream the content from a disk file. - content
Disposition String - Specifies presentational information for the object. Read w3c content_disposition for further information.
- content
Encoding String - 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.
- content
Language String - The language the content is in e.g. en-US or en-GB.
- content
Type String - 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.
- etag String
- Used to trigger updates.
- force
Destroy Boolean Allow the object to be deleted by removing any legal hold on any object version. Default is
false
. This value should be set totrue
only if the bucket has S3 object lock enabled.If no content is provided through
source
,content
orcontent_base64
, then the object will be empty.Note: The provider ignores all leading
/
s in the object'skey
and treats multiple/
s in the rest of the object'skey
as a single/
, so values of/index.html
andindex.html
correspond to the same S3 object as dofirst//second///third//
andfirst/second/third/
.- metadata Map<String>
- 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). - source String
- The path to a file that will be read and uploaded as raw bytes for the object content.
- website
Redirect String - Specifies a target URL for website redirect.
Outputs
All input properties are implicitly available as output properties. Additionally, the SpacesBucketObject resource produces the following output properties:
- id str
- The provider-assigned unique ID for this managed resource.
- version_
id str - A unique version ID value for the object, if bucket versioning is enabled.
Look up Existing SpacesBucketObject Resource
Get an existing SpacesBucketObject resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: SpacesBucketObjectState, opts?: CustomResourceOptions): SpacesBucketObject
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
acl: Optional[str] = None,
bucket: Optional[str] = None,
cache_control: Optional[str] = None,
content: Optional[str] = None,
content_base64: Optional[str] = None,
content_disposition: Optional[str] = None,
content_encoding: Optional[str] = None,
content_language: Optional[str] = None,
content_type: Optional[str] = None,
etag: Optional[str] = None,
force_destroy: Optional[bool] = None,
key: Optional[str] = None,
metadata: Optional[Mapping[str, str]] = None,
region: Optional[str] = None,
source: Optional[str] = None,
version_id: Optional[str] = None,
website_redirect: Optional[str] = None) -> SpacesBucketObject
func GetSpacesBucketObject(ctx *Context, name string, id IDInput, state *SpacesBucketObjectState, opts ...ResourceOption) (*SpacesBucketObject, error)
public static SpacesBucketObject Get(string name, Input<string> id, SpacesBucketObjectState? state, CustomResourceOptions? opts = null)
public static SpacesBucketObject get(String name, Output<String> id, SpacesBucketObjectState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Acl string
- The canned ACL to apply. DigitalOcean supports "private" and "public-read". (Defaults to "private".)
- Bucket string
- The name of the bucket to put the file in.
- Cache
Control string - Specifies caching behavior along the request/reply chain Read w3c cache_control for further details.
- Content string
- Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text.
- Content
Base64 string - 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, usesource
to stream the content from a disk file. - Content
Disposition string - Specifies presentational information for the object. Read w3c content_disposition for further information.
- Content
Encoding string - 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.
- Content
Language string - The language the content is in e.g. en-US or en-GB.
- Content
Type string - 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.
- Etag string
- Used to trigger updates.
- Force
Destroy bool Allow the object to be deleted by removing any legal hold on any object version. Default is
false
. This value should be set totrue
only if the bucket has S3 object lock enabled.If no content is provided through
source
,content
orcontent_base64
, then the object will be empty.Note: The provider ignores all leading
/
s in the object'skey
and treats multiple/
s in the rest of the object'skey
as a single/
, so values of/index.html
andindex.html
correspond to the same S3 object as dofirst//second///third//
andfirst/second/third/
.- Key string
- The name of the object once it is in the bucket.
- Metadata Dictionary<string, string>
- 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). - Region string
- The region where the bucket resides (Defaults to
nyc3
) - Source string
- The path to a file that will be read and uploaded as raw bytes for the object content.
- Version
Id string - A unique version ID value for the object, if bucket versioning is enabled.
- Website
Redirect string - Specifies a target URL for website redirect.
- Acl string
- The canned ACL to apply. DigitalOcean supports "private" and "public-read". (Defaults to "private".)
- Bucket string
- The name of the bucket to put the file in.
- Cache
Control string - Specifies caching behavior along the request/reply chain Read w3c cache_control for further details.
- Content string
- Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text.
- Content
Base64 string - 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, usesource
to stream the content from a disk file. - Content
Disposition string - Specifies presentational information for the object. Read w3c content_disposition for further information.
- Content
Encoding string - 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.
- Content
Language string - The language the content is in e.g. en-US or en-GB.
- Content
Type string - 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.
- Etag string
- Used to trigger updates.
- Force
Destroy bool Allow the object to be deleted by removing any legal hold on any object version. Default is
false
. This value should be set totrue
only if the bucket has S3 object lock enabled.If no content is provided through
source
,content
orcontent_base64
, then the object will be empty.Note: The provider ignores all leading
/
s in the object'skey
and treats multiple/
s in the rest of the object'skey
as a single/
, so values of/index.html
andindex.html
correspond to the same S3 object as dofirst//second///third//
andfirst/second/third/
.- Key string
- The name of the object once it is in the bucket.
- Metadata map[string]string
- 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). - Region string
- The region where the bucket resides (Defaults to
nyc3
) - Source string
- The path to a file that will be read and uploaded as raw bytes for the object content.
- Version
Id string - A unique version ID value for the object, if bucket versioning is enabled.
- Website
Redirect string - Specifies a target URL for website redirect.
- acl String
- The canned ACL to apply. DigitalOcean supports "private" and "public-read". (Defaults to "private".)
- bucket String
- The name of the bucket to put the file in.
- cache
Control String - Specifies caching behavior along the request/reply chain Read w3c cache_control for further details.
- content String
- Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text.
- content
Base64 String - 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, usesource
to stream the content from a disk file. - content
Disposition String - Specifies presentational information for the object. Read w3c content_disposition for further information.
- content
Encoding String - 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.
- content
Language String - The language the content is in e.g. en-US or en-GB.
- content
Type String - 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.
- etag String
- Used to trigger updates.
- force
Destroy Boolean Allow the object to be deleted by removing any legal hold on any object version. Default is
false
. This value should be set totrue
only if the bucket has S3 object lock enabled.If no content is provided through
source
,content
orcontent_base64
, then the object will be empty.Note: The provider ignores all leading
/
s in the object'skey
and treats multiple/
s in the rest of the object'skey
as a single/
, so values of/index.html
andindex.html
correspond to the same S3 object as dofirst//second///third//
andfirst/second/third/
.- key String
- The name of the object once it is in the bucket.
- metadata Map<String,String>
- 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). - region String
- The region where the bucket resides (Defaults to
nyc3
) - source String
- The path to a file that will be read and uploaded as raw bytes for the object content.
- version
Id String - A unique version ID value for the object, if bucket versioning is enabled.
- website
Redirect String - Specifies a target URL for website redirect.
- acl string
- The canned ACL to apply. DigitalOcean supports "private" and "public-read". (Defaults to "private".)
- bucket string
- The name of the bucket to put the file in.
- cache
Control string - Specifies caching behavior along the request/reply chain Read w3c cache_control for further details.
- content string
- Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text.
- content
Base64 string - 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, usesource
to stream the content from a disk file. - content
Disposition string - Specifies presentational information for the object. Read w3c content_disposition for further information.
- content
Encoding string - 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.
- content
Language string - The language the content is in e.g. en-US or en-GB.
- content
Type string - 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.
- etag string
- Used to trigger updates.
- force
Destroy boolean Allow the object to be deleted by removing any legal hold on any object version. Default is
false
. This value should be set totrue
only if the bucket has S3 object lock enabled.If no content is provided through
source
,content
orcontent_base64
, then the object will be empty.Note: The provider ignores all leading
/
s in the object'skey
and treats multiple/
s in the rest of the object'skey
as a single/
, so values of/index.html
andindex.html
correspond to the same S3 object as dofirst//second///third//
andfirst/second/third/
.- key string
- The name of the object once it is in the bucket.
- metadata {[key: string]: string}
- 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). - region string
- The region where the bucket resides (Defaults to
nyc3
) - source string
- The path to a file that will be read and uploaded as raw bytes for the object content.
- version
Id string - A unique version ID value for the object, if bucket versioning is enabled.
- website
Redirect string - Specifies a target URL for website redirect.
- acl str
- The canned ACL to apply. DigitalOcean supports "private" and "public-read". (Defaults to "private".)
- bucket str
- The name of the bucket to put the file in.
- cache_
control str - Specifies caching behavior along the request/reply chain Read w3c cache_control for further details.
- content str
- Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text.
- content_
base64 str - 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, usesource
to stream the content from a disk file. - content_
disposition str - Specifies presentational information for the object. Read w3c content_disposition for further information.
- content_
encoding str - 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.
- content_
language str - The language the content is in e.g. en-US or en-GB.
- content_
type str - 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.
- etag str
- Used to trigger updates.
- force_
destroy bool Allow the object to be deleted by removing any legal hold on any object version. Default is
false
. This value should be set totrue
only if the bucket has S3 object lock enabled.If no content is provided through
source
,content
orcontent_base64
, then the object will be empty.Note: The provider ignores all leading
/
s in the object'skey
and treats multiple/
s in the rest of the object'skey
as a single/
, so values of/index.html
andindex.html
correspond to the same S3 object as dofirst//second///third//
andfirst/second/third/
.- key str
- The name of the object once it is in the bucket.
- metadata Mapping[str, str]
- 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). - region str
- The region where the bucket resides (Defaults to
nyc3
) - source str
- The path to a file that will be read and uploaded as raw bytes for the object content.
- version_
id str - A unique version ID value for the object, if bucket versioning is enabled.
- website_
redirect str - Specifies a target URL for website redirect.
- acl String
- The canned ACL to apply. DigitalOcean supports "private" and "public-read". (Defaults to "private".)
- bucket String
- The name of the bucket to put the file in.
- cache
Control String - Specifies caching behavior along the request/reply chain Read w3c cache_control for further details.
- content String
- Literal string value to use as the object content, which will be uploaded as UTF-8-encoded text.
- content
Base64 String - 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, usesource
to stream the content from a disk file. - content
Disposition String - Specifies presentational information for the object. Read w3c content_disposition for further information.
- content
Encoding String - 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.
- content
Language String - The language the content is in e.g. en-US or en-GB.
- content
Type String - 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.
- etag String
- Used to trigger updates.
- force
Destroy Boolean Allow the object to be deleted by removing any legal hold on any object version. Default is
false
. This value should be set totrue
only if the bucket has S3 object lock enabled.If no content is provided through
source
,content
orcontent_base64
, then the object will be empty.Note: The provider ignores all leading
/
s in the object'skey
and treats multiple/
s in the rest of the object'skey
as a single/
, so values of/index.html
andindex.html
correspond to the same S3 object as dofirst//second///third//
andfirst/second/third/
.- key String
- The name of the object once it is in the bucket.
- metadata Map<String>
- 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). - region String
- The region where the bucket resides (Defaults to
nyc3
) - source String
- The path to a file that will be read and uploaded as raw bytes for the object content.
- version
Id String - A unique version ID value for the object, if bucket versioning is enabled.
- website
Redirect String - Specifies a target URL for website redirect.
Import
Importing this resource is not supported.
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- DigitalOcean pulumi/pulumi-digitalocean
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
digitalocean
Terraform Provider.