BucketObject

Provides a S3 bucket object resource.

Example Usage

Uploading a file to a bucket

Coming soon!

Coming soon!

Coming soon!

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const object = new aws.s3.BucketObject("object", {
    bucket: "your_bucket_name",
    // The filemd5() function is available in this provider 0.11.12 and later
    // For this provider 0.11.11 and earlier, use the md5() function and the file() function:
    // etag = "${md5(file("path/to/file"))}"
    etag: (() => {
        throw "tf2pulumi error: NYI: call to filemd5";
        return (() => { throw "NYI: call to filemd5"; })();
    })(),
    key: "new_object_key",
    source: new pulumi.asset.FileAsset("path/to/file"),
});

Encrypting with KMS Key

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var examplekms = new Aws.Kms.Key("examplekms", new Aws.Kms.KeyArgs
        {
            DeletionWindowInDays = 7,
            Description = "KMS key 1",
        });
        var examplebucket = new Aws.S3.Bucket("examplebucket", new Aws.S3.BucketArgs
        {
            Acl = "private",
        });
        var examplebucketObject = new Aws.S3.BucketObject("examplebucketObject", new Aws.S3.BucketObjectArgs
        {
            Bucket = examplebucket.Id,
            Key = "someobject",
            KmsKeyId = examplekms.Arn,
            Source = new FileAsset("index.html"),
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/kms"
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/s3"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        examplekms, err := kms.NewKey(ctx, "examplekms", &kms.KeyArgs{
            DeletionWindowInDays: pulumi.Int(7),
            Description:          pulumi.String("KMS key 1"),
        })
        if err != nil {
            return err
        }
        examplebucket, err := s3.NewBucket(ctx, "examplebucket", &s3.BucketArgs{
            Acl: pulumi.String("private"),
        })
        if err != nil {
            return err
        }
        _, err = s3.NewBucketObject(ctx, "examplebucketObject", &s3.BucketObjectArgs{
            Bucket:   examplebucket.ID(),
            Key:      pulumi.String("someobject"),
            KmsKeyId: examplekms.Arn,
            Source:   pulumi.NewFileAsset("index.html"),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

examplekms = aws.kms.Key("examplekms",
    deletion_window_in_days=7,
    description="KMS key 1")
examplebucket = aws.s3.Bucket("examplebucket", acl="private")
examplebucket_object = aws.s3.BucketObject("examplebucketObject",
    bucket=examplebucket.id,
    key="someobject",
    kms_key_id=examplekms.arn,
    source=pulumi.FileAsset("index.html"))
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const examplekms = new aws.kms.Key("examplekms", {
    deletionWindowInDays: 7,
    description: "KMS key 1",
});
const examplebucket = new aws.s3.Bucket("examplebucket", {
    acl: "private",
});
const examplebucketObject = new aws.s3.BucketObject("examplebucket_object", {
    bucket: examplebucket.id,
    key: "someobject",
    kmsKeyId: examplekms.arn,
    source: new pulumi.asset.FileAsset("index.html"),
});

Server Side Encryption with S3 Default Master Key

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var examplebucket = new Aws.S3.Bucket("examplebucket", new Aws.S3.BucketArgs
        {
            Acl = "private",
        });
        var examplebucketObject = new Aws.S3.BucketObject("examplebucketObject", new Aws.S3.BucketObjectArgs
        {
            Bucket = examplebucket.Id,
            Key = "someobject",
            ServerSideEncryption = "aws:kms",
            Source = new FileAsset("index.html"),
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/s3"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        examplebucket, err := s3.NewBucket(ctx, "examplebucket", &s3.BucketArgs{
            Acl: pulumi.String("private"),
        })
        if err != nil {
            return err
        }
        _, err = s3.NewBucketObject(ctx, "examplebucketObject", &s3.BucketObjectArgs{
            Bucket:               examplebucket.ID(),
            Key:                  pulumi.String("someobject"),
            ServerSideEncryption: pulumi.String("aws:kms"),
            Source:               pulumi.NewFileAsset("index.html"),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

examplebucket = aws.s3.Bucket("examplebucket", acl="private")
examplebucket_object = aws.s3.BucketObject("examplebucketObject",
    bucket=examplebucket.id,
    key="someobject",
    server_side_encryption="aws:kms",
    source=pulumi.FileAsset("index.html"))
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const examplebucket = new aws.s3.Bucket("examplebucket", {
    acl: "private",
});
const examplebucketObject = new aws.s3.BucketObject("examplebucket_object", {
    bucket: examplebucket.id,
    key: "someobject",
    serverSideEncryption: "aws:kms",
    source: new pulumi.asset.FileAsset("index.html"),
});

Server Side Encryption with AWS-Managed Key

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var examplebucket = new Aws.S3.Bucket("examplebucket", new Aws.S3.BucketArgs
        {
            Acl = "private",
        });
        var examplebucketObject = new Aws.S3.BucketObject("examplebucketObject", new Aws.S3.BucketObjectArgs
        {
            Bucket = examplebucket.Id,
            Key = "someobject",
            ServerSideEncryption = "AES256",
            Source = new FileAsset("index.html"),
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/s3"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        examplebucket, err := s3.NewBucket(ctx, "examplebucket", &s3.BucketArgs{
            Acl: pulumi.String("private"),
        })
        if err != nil {
            return err
        }
        _, err = s3.NewBucketObject(ctx, "examplebucketObject", &s3.BucketObjectArgs{
            Bucket:               examplebucket.ID(),
            Key:                  pulumi.String("someobject"),
            ServerSideEncryption: pulumi.String("AES256"),
            Source:               pulumi.NewFileAsset("index.html"),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

examplebucket = aws.s3.Bucket("examplebucket", acl="private")
examplebucket_object = aws.s3.BucketObject("examplebucketObject",
    bucket=examplebucket.id,
    key="someobject",
    server_side_encryption="AES256",
    source=pulumi.FileAsset("index.html"))
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const examplebucket = new aws.s3.Bucket("examplebucket", {
    acl: "private",
});
const examplebucketObject = new aws.s3.BucketObject("examplebucket_object", {
    bucket: examplebucket.id,
    key: "someobject",
    serverSideEncryption: "AES256",
    source: new pulumi.asset.FileAsset("index.html"),
});

S3 Object Lock

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var examplebucket = new Aws.S3.Bucket("examplebucket", new Aws.S3.BucketArgs
        {
            Acl = "private",
            ObjectLockConfiguration = new Aws.S3.Inputs.BucketObjectLockConfigurationArgs
            {
                ObjectLockEnabled = "Enabled",
            },
            Versioning = new Aws.S3.Inputs.BucketVersioningArgs
            {
                Enabled = true,
            },
        });
        var examplebucketObject = new Aws.S3.BucketObject("examplebucketObject", new Aws.S3.BucketObjectArgs
        {
            Bucket = examplebucket.Id,
            ForceDestroy = true,
            Key = "someobject",
            ObjectLockLegalHoldStatus = "ON",
            ObjectLockMode = "GOVERNANCE",
            ObjectLockRetainUntilDate = "2021-12-31T23:59:60Z",
            Source = new FileAsset("important.txt"),
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/s3"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        examplebucket, err := s3.NewBucket(ctx, "examplebucket", &s3.BucketArgs{
            Acl: pulumi.String("private"),
            ObjectLockConfiguration: &s3.BucketObjectLockConfigurationArgs{
                ObjectLockEnabled: pulumi.String("Enabled"),
            },
            Versioning: &s3.BucketVersioningArgs{
                Enabled: pulumi.Bool(true),
            },
        })
        if err != nil {
            return err
        }
        _, err = s3.NewBucketObject(ctx, "examplebucketObject", &s3.BucketObjectArgs{
            Bucket:                    examplebucket.ID(),
            ForceDestroy:              pulumi.Bool(true),
            Key:                       pulumi.String("someobject"),
            ObjectLockLegalHoldStatus: pulumi.String("ON"),
            ObjectLockMode:            pulumi.String("GOVERNANCE"),
            ObjectLockRetainUntilDate: pulumi.String("2021-12-31T23:59:60Z"),
            Source:                    pulumi.NewFileAsset("important.txt"),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

examplebucket = aws.s3.Bucket("examplebucket",
    acl="private",
    object_lock_configuration={
        "objectLockEnabled": "Enabled",
    },
    versioning={
        "enabled": True,
    })
examplebucket_object = aws.s3.BucketObject("examplebucketObject",
    bucket=examplebucket.id,
    force_destroy=True,
    key="someobject",
    object_lock_legal_hold_status="ON",
    object_lock_mode="GOVERNANCE",
    object_lock_retain_until_date="2021-12-31T23:59:60Z",
    source=pulumi.FileAsset("important.txt"))
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const examplebucket = new aws.s3.Bucket("examplebucket", {
    acl: "private",
    objectLockConfiguration: {
        objectLockEnabled: "Enabled",
    },
    versioning: {
        enabled: true,
    },
});
const examplebucketObject = new aws.s3.BucketObject("examplebucket_object", {
    bucket: examplebucket.id,
    forceDestroy: true,
    key: "someobject",
    objectLockLegalHoldStatus: "ON",
    objectLockMode: "GOVERNANCE",
    objectLockRetainUntilDate: "2021-12-31T23:59:60Z",
    source: new pulumi.asset.FileAsset("important.txt"),
});

Create a BucketObject Resource

def BucketObject(resource_name, opts=None, acl=None, bucket=None, cache_control=None, content=None, content_base64=None, content_disposition=None, content_encoding=None, content_language=None, content_type=None, etag=None, force_destroy=None, key=None, kms_key_id=None, metadata=None, object_lock_legal_hold_status=None, object_lock_mode=None, object_lock_retain_until_date=None, server_side_encryption=None, source=None, storage_class=None, tags=None, website_redirect=None, __props__=None);
func NewBucketObject(ctx *Context, name string, args BucketObjectArgs, opts ...ResourceOption) (*BucketObject, error)
name string
The unique name of the resource.
args BucketObjectArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args BucketObjectArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args BucketObjectArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

BucketObject Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The BucketObject resource accepts the following input properties:

Bucket string

The name of the bucket to put the file in. Alternatively, an S3 access point ARN can be specified.

Acl string

The canned ACL to apply. Defaults to “private”.

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

ContentBase64 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, use source to stream the content from a disk file.

ContentDisposition string

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

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

ContentLanguage string

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

ContentType 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. The only meaningful value is ${filemd5("path/to/file")} (this provider 0.11.12 or later) or ${md5(file("path/to/file"))} (this provider 0.11.11 or earlier). This attribute is not compatible with KMS encryption, kms_key_id or server_side_encryption = "aws:kms".

ForceDestroy bool

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.

Key string

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

KmsKeyId string

Specifies the AWS KMS Key ARN to use for object encryption. This value is a fully qualified ARN of the KMS Key. If using aws.kms.Key, use the exported arn attribute: kms_key_id = "${aws_kms_key.foo.arn}"

Metadata Dictionary<string, string>

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

ObjectLockLegalHoldStatus string

The legal hold status that you want to apply to the specified object. Valid values are ON and OFF.

ObjectLockMode string

The object lock retention mode that you want to apply to this object. Valid values are GOVERNANCE and COMPLIANCE.

ObjectLockRetainUntilDate string

The date and time, in RFC3339 format, when this object’s object lock will expire.

ServerSideEncryption string

Specifies server-side encryption of the object in S3. Valid values are “AES256” and “aws:kms”.

Source AssetOrArchive

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

StorageClass string

Specifies the desired Storage Class for the object. Can be either “STANDARD”, “REDUCED_REDUNDANCY”, “ONEZONE_IA”, “INTELLIGENT_TIERING”, “GLACIER”, “DEEP_ARCHIVE”, or “STANDARD_IA”. Defaults to “STANDARD”.

Tags Dictionary<string, string>

A map of tags to assign to the object.

WebsiteRedirect string

Specifies a target URL for website redirect.

Bucket interface{}

The name of the bucket to put the file in. Alternatively, an S3 access point ARN can be specified.

Acl string

The canned ACL to apply. Defaults to “private”.

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

ContentBase64 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, use source to stream the content from a disk file.

ContentDisposition string

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

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

ContentLanguage string

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

ContentType 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. The only meaningful value is ${filemd5("path/to/file")} (this provider 0.11.12 or later) or ${md5(file("path/to/file"))} (this provider 0.11.11 or earlier). This attribute is not compatible with KMS encryption, kms_key_id or server_side_encryption = "aws:kms".

ForceDestroy bool

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.

Key string

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

KmsKeyId string

Specifies the AWS KMS Key ARN to use for object encryption. This value is a fully qualified ARN of the KMS Key. If using aws.kms.Key, use the exported arn attribute: kms_key_id = "${aws_kms_key.foo.arn}"

Metadata map[string]string

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

ObjectLockLegalHoldStatus string

The legal hold status that you want to apply to the specified object. Valid values are ON and OFF.

ObjectLockMode string

The object lock retention mode that you want to apply to this object. Valid values are GOVERNANCE and COMPLIANCE.

ObjectLockRetainUntilDate string

The date and time, in RFC3339 format, when this object’s object lock will expire.

ServerSideEncryption string

Specifies server-side encryption of the object in S3. Valid values are “AES256” and “aws:kms”.

Source pulumi.AssetOrArchive

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

StorageClass string

Specifies the desired Storage Class for the object. Can be either “STANDARD”, “REDUCED_REDUNDANCY”, “ONEZONE_IA”, “INTELLIGENT_TIERING”, “GLACIER”, “DEEP_ARCHIVE”, or “STANDARD_IA”. Defaults to “STANDARD”.

Tags map[string]string

A map of tags to assign to the object.

WebsiteRedirect string

Specifies a target URL for website redirect.

bucket string | Bucket

The name of the bucket to put the file in. Alternatively, an S3 access point ARN can be specified.

acl string

The canned ACL to apply. Defaults to “private”.

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

contentBase64 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, use source to stream the content from a disk file.

contentDisposition string

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

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

contentLanguage string

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

contentType 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. The only meaningful value is ${filemd5("path/to/file")} (this provider 0.11.12 or later) or ${md5(file("path/to/file"))} (this provider 0.11.11 or earlier). This attribute is not compatible with KMS encryption, kms_key_id or server_side_encryption = "aws:kms".

forceDestroy boolean

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.

key string

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

kmsKeyId string

Specifies the AWS KMS Key ARN to use for object encryption. This value is a fully qualified ARN of the KMS Key. If using aws.kms.Key, use the exported arn attribute: kms_key_id = "${aws_kms_key.foo.arn}"

metadata {[key: string]: string}

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

objectLockLegalHoldStatus string

The legal hold status that you want to apply to the specified object. Valid values are ON and OFF.

objectLockMode string

The object lock retention mode that you want to apply to this object. Valid values are GOVERNANCE and COMPLIANCE.

objectLockRetainUntilDate string

The date and time, in RFC3339 format, when this object’s object lock will expire.

serverSideEncryption string

Specifies server-side encryption of the object in S3. Valid values are “AES256” and “aws:kms”.

source pulumi.asset.Asset | pulumi.asset.Archive

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

storageClass string

Specifies the desired Storage Class for the object. Can be either “STANDARD”, “REDUCED_REDUNDANCY”, “ONEZONE_IA”, “INTELLIGENT_TIERING”, “GLACIER”, “DEEP_ARCHIVE”, or “STANDARD_IA”. Defaults to “STANDARD”.

tags {[key: string]: string}

A map of tags to assign to the object.

websiteRedirect string

Specifies a target URL for website redirect.

bucket string | str

The name of the bucket to put the file in. Alternatively, an S3 access point ARN can be specified.

acl str

The canned ACL to apply. 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, use source 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. The only meaningful value is ${filemd5("path/to/file")} (this provider 0.11.12 or later) or ${md5(file("path/to/file"))} (this provider 0.11.11 or earlier). This attribute is not compatible with KMS encryption, kms_key_id or server_side_encryption = "aws:kms".

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 to true only if the bucket has S3 object lock enabled.

key str

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

kms_key_id str

Specifies the AWS KMS Key ARN to use for object encryption. This value is a fully qualified ARN of the KMS Key. If using aws.kms.Key, use the exported arn attribute: kms_key_id = "${aws_kms_key.foo.arn}"

metadata Dict[str, str]

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

object_lock_legal_hold_status str

The legal hold status that you want to apply to the specified object. Valid values are ON and OFF.

object_lock_mode str

The object lock retention mode that you want to apply to this object. Valid values are GOVERNANCE and COMPLIANCE.

object_lock_retain_until_date str

The date and time, in RFC3339 format, when this object’s object lock will expire.

server_side_encryption str

Specifies server-side encryption of the object in S3. Valid values are “AES256” and “aws:kms”.

source Union[pulumi.Asset, pulumi.Archive]

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

storage_class str

Specifies the desired Storage Class for the object. Can be either “STANDARD”, “REDUCED_REDUNDANCY”, “ONEZONE_IA”, “INTELLIGENT_TIERING”, “GLACIER”, “DEEP_ARCHIVE”, or “STANDARD_IA”. Defaults to “STANDARD”.

tags Dict[str, str]

A map of tags to assign to the object.

website_redirect str

Specifies a target URL for website redirect.

Outputs

All input properties are implicitly available as output properties. Additionally, the BucketObject resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
VersionId string

A unique version ID value for the object, if bucket versioning is enabled.

Id string
The provider-assigned unique ID for this managed resource.
VersionId string

A unique version ID value for the object, if bucket versioning is enabled.

id string
The provider-assigned unique ID for this managed resource.
versionId string

A unique version ID value for the object, if bucket versioning is enabled.

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 an Existing BucketObject Resource

Get an existing BucketObject 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?: BucketObjectState, opts?: CustomResourceOptions): BucketObject
static get(resource_name, id, opts=None, acl=None, bucket=None, cache_control=None, content=None, content_base64=None, content_disposition=None, content_encoding=None, content_language=None, content_type=None, etag=None, force_destroy=None, key=None, kms_key_id=None, metadata=None, object_lock_legal_hold_status=None, object_lock_mode=None, object_lock_retain_until_date=None, server_side_encryption=None, source=None, storage_class=None, tags=None, version_id=None, website_redirect=None, __props__=None);
func GetBucketObject(ctx *Context, name string, id IDInput, state *BucketObjectState, opts ...ResourceOption) (*BucketObject, error)
public static BucketObject Get(string name, Input<string> id, BucketObjectState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

Acl string

The canned ACL to apply. Defaults to “private”.

Bucket string

The name of the bucket to put the file in. Alternatively, an S3 access point ARN can be specified.

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

ContentBase64 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, use source to stream the content from a disk file.

ContentDisposition string

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

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

ContentLanguage string

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

ContentType 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. The only meaningful value is ${filemd5("path/to/file")} (this provider 0.11.12 or later) or ${md5(file("path/to/file"))} (this provider 0.11.11 or earlier). This attribute is not compatible with KMS encryption, kms_key_id or server_side_encryption = "aws:kms".

ForceDestroy bool

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.

Key string

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

KmsKeyId string

Specifies the AWS KMS Key ARN to use for object encryption. This value is a fully qualified ARN of the KMS Key. If using aws.kms.Key, use the exported arn attribute: kms_key_id = "${aws_kms_key.foo.arn}"

Metadata Dictionary<string, string>

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

ObjectLockLegalHoldStatus string

The legal hold status that you want to apply to the specified object. Valid values are ON and OFF.

ObjectLockMode string

The object lock retention mode that you want to apply to this object. Valid values are GOVERNANCE and COMPLIANCE.

ObjectLockRetainUntilDate string

The date and time, in RFC3339 format, when this object’s object lock will expire.

ServerSideEncryption string

Specifies server-side encryption of the object in S3. Valid values are “AES256” and “aws:kms”.

Source AssetOrArchive

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

StorageClass string

Specifies the desired Storage Class for the object. Can be either “STANDARD”, “REDUCED_REDUNDANCY”, “ONEZONE_IA”, “INTELLIGENT_TIERING”, “GLACIER”, “DEEP_ARCHIVE”, or “STANDARD_IA”. Defaults to “STANDARD”.

Tags Dictionary<string, string>

A map of tags to assign to the object.

VersionId string

A unique version ID value for the object, if bucket versioning is enabled.

WebsiteRedirect string

Specifies a target URL for website redirect.

Acl string

The canned ACL to apply. Defaults to “private”.

Bucket interface{}

The name of the bucket to put the file in. Alternatively, an S3 access point ARN can be specified.

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

ContentBase64 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, use source to stream the content from a disk file.

ContentDisposition string

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

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

ContentLanguage string

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

ContentType 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. The only meaningful value is ${filemd5("path/to/file")} (this provider 0.11.12 or later) or ${md5(file("path/to/file"))} (this provider 0.11.11 or earlier). This attribute is not compatible with KMS encryption, kms_key_id or server_side_encryption = "aws:kms".

ForceDestroy bool

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.

Key string

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

KmsKeyId string

Specifies the AWS KMS Key ARN to use for object encryption. This value is a fully qualified ARN of the KMS Key. If using aws.kms.Key, use the exported arn attribute: kms_key_id = "${aws_kms_key.foo.arn}"

Metadata map[string]string

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

ObjectLockLegalHoldStatus string

The legal hold status that you want to apply to the specified object. Valid values are ON and OFF.

ObjectLockMode string

The object lock retention mode that you want to apply to this object. Valid values are GOVERNANCE and COMPLIANCE.

ObjectLockRetainUntilDate string

The date and time, in RFC3339 format, when this object’s object lock will expire.

ServerSideEncryption string

Specifies server-side encryption of the object in S3. Valid values are “AES256” and “aws:kms”.

Source pulumi.AssetOrArchive

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

StorageClass string

Specifies the desired Storage Class for the object. Can be either “STANDARD”, “REDUCED_REDUNDANCY”, “ONEZONE_IA”, “INTELLIGENT_TIERING”, “GLACIER”, “DEEP_ARCHIVE”, or “STANDARD_IA”. Defaults to “STANDARD”.

Tags map[string]string

A map of tags to assign to the object.

VersionId string

A unique version ID value for the object, if bucket versioning is enabled.

WebsiteRedirect string

Specifies a target URL for website redirect.

acl string

The canned ACL to apply. Defaults to “private”.

bucket string | Bucket

The name of the bucket to put the file in. Alternatively, an S3 access point ARN can be specified.

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

contentBase64 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, use source to stream the content from a disk file.

contentDisposition string

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

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

contentLanguage string

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

contentType 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. The only meaningful value is ${filemd5("path/to/file")} (this provider 0.11.12 or later) or ${md5(file("path/to/file"))} (this provider 0.11.11 or earlier). This attribute is not compatible with KMS encryption, kms_key_id or server_side_encryption = "aws:kms".

forceDestroy boolean

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.

key string

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

kmsKeyId string

Specifies the AWS KMS Key ARN to use for object encryption. This value is a fully qualified ARN of the KMS Key. If using aws.kms.Key, use the exported arn attribute: kms_key_id = "${aws_kms_key.foo.arn}"

metadata {[key: string]: string}

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

objectLockLegalHoldStatus string

The legal hold status that you want to apply to the specified object. Valid values are ON and OFF.

objectLockMode string

The object lock retention mode that you want to apply to this object. Valid values are GOVERNANCE and COMPLIANCE.

objectLockRetainUntilDate string

The date and time, in RFC3339 format, when this object’s object lock will expire.

serverSideEncryption string

Specifies server-side encryption of the object in S3. Valid values are “AES256” and “aws:kms”.

source pulumi.asset.Asset | pulumi.asset.Archive

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

storageClass string

Specifies the desired Storage Class for the object. Can be either “STANDARD”, “REDUCED_REDUNDANCY”, “ONEZONE_IA”, “INTELLIGENT_TIERING”, “GLACIER”, “DEEP_ARCHIVE”, or “STANDARD_IA”. Defaults to “STANDARD”.

tags {[key: string]: string}

A map of tags to assign to the object.

versionId string

A unique version ID value for the object, if bucket versioning is enabled.

websiteRedirect string

Specifies a target URL for website redirect.

acl str

The canned ACL to apply. Defaults to “private”.

bucket string | str

The name of the bucket to put the file in. Alternatively, an S3 access point ARN can be specified.

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, use source 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. The only meaningful value is ${filemd5("path/to/file")} (this provider 0.11.12 or later) or ${md5(file("path/to/file"))} (this provider 0.11.11 or earlier). This attribute is not compatible with KMS encryption, kms_key_id or server_side_encryption = "aws:kms".

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 to true only if the bucket has S3 object lock enabled.

key str

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

kms_key_id str

Specifies the AWS KMS Key ARN to use for object encryption. This value is a fully qualified ARN of the KMS Key. If using aws.kms.Key, use the exported arn attribute: kms_key_id = "${aws_kms_key.foo.arn}"

metadata Dict[str, str]

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

object_lock_legal_hold_status str

The legal hold status that you want to apply to the specified object. Valid values are ON and OFF.

object_lock_mode str

The object lock retention mode that you want to apply to this object. Valid values are GOVERNANCE and COMPLIANCE.

object_lock_retain_until_date str

The date and time, in RFC3339 format, when this object’s object lock will expire.

server_side_encryption str

Specifies server-side encryption of the object in S3. Valid values are “AES256” and “aws:kms”.

source Union[pulumi.Asset, pulumi.Archive]

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

storage_class str

Specifies the desired Storage Class for the object. Can be either “STANDARD”, “REDUCED_REDUNDANCY”, “ONEZONE_IA”, “INTELLIGENT_TIERING”, “GLACIER”, “DEEP_ARCHIVE”, or “STANDARD_IA”. Defaults to “STANDARD”.

tags Dict[str, str]

A map of tags to assign to the object.

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.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.