ObjectCopy class

Provides a resource for copying an S3 object.

Example Usage

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

const test = new aws.s3.ObjectCopy("test", {
    grants: [{
        uri: "http://acs.amazonaws.com/groups/global/AllUsers",
        type: "Group",
        permissions: ["READ"],
    }],
    bucket: "destination_bucket",
    key: "destination_key",
    source: "source_bucket/source_key",
});
import pulumi
import pulumi_aws as aws

test = aws.s3.ObjectCopy("test",
    grants=[{
        "uri": "http://acs.amazonaws.com/groups/global/AllUsers",
        "type": "Group",
        "permissions": ["READ"],
    }],
    bucket="destination_bucket",
    key="destination_key",
    source="source_bucket/source_key")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var test = new Aws.S3.ObjectCopy("test", new()
    {
        Grants = new[]
        {
            new Aws.S3.Inputs.ObjectCopyGrantArgs
            {
                Uri = "http://acs.amazonaws.com/groups/global/AllUsers",
                Type = "Group",
                Permissions = new[]
                {
                    "READ",
                },
            },
        },
        Bucket = "destination_bucket",
        Key = "destination_key",
        Source = "source_bucket/source_key",
    });

});
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := s3.NewObjectCopy(ctx, "test", &s3.ObjectCopyArgs{
			Grants: s3.ObjectCopyGrantArray{
				&s3.ObjectCopyGrantArgs{
					Uri:  pulumi.String("http://acs.amazonaws.com/groups/global/AllUsers"),
					Type: pulumi.String("Group"),
					Permissions: pulumi.StringArray{
						pulumi.String("READ"),
					},
				},
			},
			Bucket: pulumi.String("destination_bucket"),
			Key:    pulumi.String("destination_key"),
			Source: pulumi.String("source_bucket/source_key"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_s3_objectcopy" "test" {
  grants {
    uri         = "http://acs.amazonaws.com/groups/global/AllUsers"
    type        = "Group"
    permissions = ["READ"]
  }
  bucket = "destination_bucket"
  key    = "destination_key"
  source = "source_bucket/source_key"
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.s3.ObjectCopy;
import com.pulumi.aws.s3.ObjectCopyArgs;
import com.pulumi.aws.s3.inputs.ObjectCopyGrantArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 test = new ObjectCopy("test", ObjectCopyArgs.builder()
            .grants(ObjectCopyGrantArgs.builder()
                .uri("http://acs.amazonaws.com/groups/global/AllUsers")
                .type("Group")
                .permissions("READ")
                .build())
            .bucket("destination_bucket")
            .key("destination_key")
            .source("source_bucket/source_key")
            .build());

    }
}
resources:
  test:
    type: aws:s3:ObjectCopy
    properties:
      grants:
        - uri: http://acs.amazonaws.com/groups/global/AllUsers
          type: Group
          permissions:
            - READ
      bucket: destination_bucket
      key: destination_key
      source: source_bucket/source_key

Ignoring Provider defaultTags

S3 objects support a maximum of 10 tags. If the resource's own tags and the provider-level defaultTags would together lead to more than 10 tags on an S3 object copy, use the overrideProvider configuration block to suppress any provider-level defaultTags.

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

const test = new aws.s3.ObjectCopy("test", {
    overrideProvider: {
        defaultTags: {
            tags: {},
        },
    },
    bucket: "destination_bucket",
    key: "destination_key",
    source: "source_bucket/source_key",
});
import pulumi
import pulumi_aws as aws

test = aws.s3.ObjectCopy("test",
    override_provider={
        "default_tags": {
            "tags": {},
        },
    },
    bucket="destination_bucket",
    key="destination_key",
    source="source_bucket/source_key")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var test = new Aws.S3.ObjectCopy("test", new()
    {
        OverrideProvider = new Aws.S3.Inputs.ObjectCopyOverrideProviderArgs
        {
            DefaultTags = new Aws.S3.Inputs.ObjectCopyOverrideProviderDefaultTagsArgs
            {
                Tags = null,
            },
        },
        Bucket = "destination_bucket",
        Key = "destination_key",
        Source = "source_bucket/source_key",
    });

});
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := s3.NewObjectCopy(ctx, "test", &s3.ObjectCopyArgs{
			OverrideProvider: &s3.ObjectCopyOverrideProviderArgs{
				DefaultTags: &s3.ObjectCopyOverrideProviderDefaultTagsArgs{
					Tags: pulumi.StringMap{},
				},
			},
			Bucket: pulumi.String("destination_bucket"),
			Key:    pulumi.String("destination_key"),
			Source: pulumi.String("source_bucket/source_key"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_s3_objectcopy" "test" {
  override_provider = {
    default_tags = {
      tags = {}
    }
  }
  bucket = "destination_bucket"
  key    = "destination_key"
  source = "source_bucket/source_key"
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.s3.ObjectCopy;
import com.pulumi.aws.s3.ObjectCopyArgs;
import com.pulumi.aws.s3.inputs.ObjectCopyOverrideProviderArgs;
import com.pulumi.aws.s3.inputs.ObjectCopyOverrideProviderDefaultTagsArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 test = new ObjectCopy("test", ObjectCopyArgs.builder()
            .overrideProvider(ObjectCopyOverrideProviderArgs.builder()
                .defaultTags(ObjectCopyOverrideProviderDefaultTagsArgs.builder()
                    .tags(Map.ofEntries(
                    ))
                    .build())
                .build())
            .bucket("destination_bucket")
            .key("destination_key")
            .source("source_bucket/source_key")
            .build());

    }
}
resources:
  test:
    type: aws:s3:ObjectCopy
    properties:
      overrideProvider:
        defaultTags:
          tags: {}
      bucket: destination_bucket
      key: destination_key
      source: source_bucket/source_key

Constructors

ObjectCopy(String name, {ObjectCopyArgs? args, CustomResourceOptions? options})
Creates a new ObjectCopy. name The Pulumi resource name. args Arguments used to configure this ObjectCopy. The set of arguments for ObjectCopy. options Resource options controlling this resource's behavior.
ObjectCopy.reference(String urn)
Creates a typed reference to an existing ObjectCopy resource.

Properties

acl ↔ Output<String>
Canned ACL to apply. Valid values are private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, and bucket-owner-full-control. Conflicts with grant.
latefinal
arn ↔ Output<String>
ARN of the object.
latefinal
bucket ↔ Output<String>
Name of the bucket to put the file in.
latefinal
bucketKeyEnabled ↔ Output<bool>
Whether to use an S3 Bucket Key for object encryption with server-side encryption using KMS (SSE-KMS).
latefinal
cacheControl ↔ Output<String>
Caching behavior along the request/reply chain. Read w3c cacheControl for further details.
latefinal
checksumAlgorithm ↔ Output<String?>
Algorithm used to create the checksum for the object. If a value is specified and the object is encrypted with KMS, you must have permission to use the kms:Decrypt action. Valid values: CRC32, CRC32C, CRC64NVME SHA1, SHA256.
latefinal
checksumCrc32 ↔ Output<String>
Base64-encoded, 32-bit CRC32 checksum of the object.
latefinal
checksumCrc32c ↔ Output<String>
Base64-encoded, 32-bit CRC32C checksum of the object.
latefinal
checksumCrc64nvme ↔ Output<String>
Base64-encoded, 64-bit CRC64NVME checksum of the object.
latefinal
checksumSha1 ↔ Output<String>
Base64-encoded, 160-bit SHA-1 digest of the object.
latefinal
checksumSha256 ↔ Output<String>
Base64-encoded, 256-bit SHA-256 digest of the object.
latefinal
childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
contentDisposition ↔ Output<String>
Presentational information for the object. Read w3c contentDisposition for further information.
latefinal
contentEncoding ↔ Output<String>
Content encodings that 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.
latefinal
contentLanguage ↔ Output<String>
Language the content is in e.g., en-US or en-GB.
latefinal
contentType ↔ Output<String>
Standard MIME type describing the format of the object data, e.g., application/octet-stream. All Valid MIME Types are valid for this input.
latefinal
copyIfMatch ↔ Output<String?>
Copies the object if its entity tag (ETag) matches the specified tag.
latefinal
copyIfModifiedSince ↔ Output<String?>
Copies the object if it has been modified since the specified time, in RFC3339 format.
latefinal
copyIfNoneMatch ↔ Output<String?>
Copies the object if its entity tag (ETag) is different than the specified ETag.
latefinal
copyIfUnmodifiedSince ↔ Output<String?>
Copies the object if it hasn't been modified since the specified time, in RFC3339 format.
latefinal
customerAlgorithm ↔ Output<String>
Algorithm to use when encrypting the object (for example, AES256).
latefinal
customerKey ↔ Output<String?>
Customer-provided encryption key for Amazon S3 to use in encrypting data. This value is used to store the object and then it is discarded; Amazon S3 does not store the encryption key. The key must be appropriate for use with the algorithm specified in the x-amz-server-side-encryption-customer-algorithm header.
latefinal
customerKeyMd5 ↔ Output<String>
128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure that the encryption key was transmitted without error.
latefinal
etag ↔ Output<String>
ETag generated for the object (an MD5 sum of the object content). For plaintext objects or objects encrypted with an AWS-managed key, the hash is an MD5 digest of the object data. For objects encrypted with a KMS key or objects created by either the Multipart Upload or Part Copy operation, the hash is not an MD5 digest, regardless of the method of encryption. More information on possible values can be found on Common Response Headers.
latefinal
expectedBucketOwner ↔ Output<String?>
Account id of the expected destination bucket owner. If the destination bucket is owned by a different account, the request will fail with an HTTP 403 (Access Denied) error.
latefinal
expectedSourceBucketOwner ↔ Output<String?>
Account id of the expected source bucket owner. If the source bucket is owned by a different account, the request will fail with an HTTP 403 (Access Denied) error.
latefinal
expiration ↔ Output<String>
If the object expiration is configured, this attribute will be set.
latefinal
expires ↔ Output<String?>
Date and time at which the object is no longer cacheable, in RFC3339 format.
latefinal
forceDestroy ↔ Output<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.
latefinal
grants ↔ Output<List<ObjectCopyGrant>?>
Configuration block for header grants. Documented below. Conflicts with acl.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
key ↔ Output<String>
Name of the object once it is in the bucket.
latefinal
kmsEncryptionContext ↔ Output<String>
AWS KMS Encryption Context to use for object encryption. The value is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.
latefinal
kmsKeyId ↔ Output<String>
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: kmsKeyId = aws_kms_key.foo.arn
latefinal
lastModified ↔ Output<String>
Returns the date that the object was last modified, in RFC3339 format.
latefinal
metadata ↔ Output<Map<String, String>>
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).
latefinal
metadataDirective ↔ Output<String?>
Whether the metadata is copied from the source object or replaced with metadata provided in the request. Valid values are COPY and REPLACE.
latefinal
objectLockLegalHoldStatus ↔ Output<String>
Legal hold status to apply to the specified object. Valid values are ON and OFF.
latefinal
objectLockMode ↔ Output<String>
Object lock retention mode that you want to apply to this object. Valid values are GOVERNANCE and COMPLIANCE.
latefinal
objectLockRetainUntilDate ↔ Output<String>
Date and time, in RFC3339 format, when this object's object lock will expire.
latefinal
overrideProvider ↔ Output<ObjectCopyOverrideProvider?>
latefinal
region ↔ Output<String>
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
requestCharged ↔ Output<bool>
If present, indicates that the requester was successfully charged for the request.
latefinal
requestPayer ↔ Output<String?>
Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. For information about downloading objects from requester pays buckets, see Downloading Objects in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) in the Amazon S3 Developer Guide. If included, the only valid value is requester.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
serverSideEncryption ↔ Output<String>
Server-side encryption of the object in S3. Valid values are AES256 and aws:kms.
latefinal
source ↔ Output<String>
Source object for the copy operation. You specify the value in one of two formats. For objects not accessed through an access point, specify the name of the source bucket and the key of the source object, separated by a slash (/). For example, testbucket/test1.json. For objects accessed through access points, specify the ARN of the object as accessed through the access point, in the format arn:aws:s3:&lt;Region&gt;:&lt;account-id&gt;:accesspoint/&lt;access-point-name&gt;/object/&lt;key&gt;. For example, arn:aws:s3:us-west-2:9999912999:accesspoint/my-access-point/object/testbucket/test1.json.
latefinal
sourceCustomerAlgorithm ↔ Output<String?>
Algorithm to use when decrypting the source object (for example, AES256).
latefinal
sourceCustomerKey ↔ Output<String?>
Customer-provided encryption key for Amazon S3 to use to decrypt the source object. The encryption key provided in this header must be one that was used when the source object was created.
latefinal
sourceCustomerKeyMd5 ↔ Output<String?>
128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure that the encryption key was transmitted without error.
latefinal
sourceVersionId ↔ Output<String>
Version of the copied object in the source bucket.
latefinal
storageClass ↔ Output<String>
Desired storage class for the object. Defaults to STANDARD.
latefinal
taggingDirective ↔ Output<String?>
Whether the object tag-set is copied from the source object or replaced with tag-set provided in the request. Valid values are COPY and REPLACE.
latefinal
tags ↔ Output<Map<String, String>?>
Map of tags to assign to the object. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
latefinal
tagsAll ↔ Output<Map<String, String>>
Map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.
latefinal
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited
versionId ↔ Output<String>
Version ID of the newly created copy.
latefinal
websiteRedirect ↔ Output<String>
Target URL for website redirect.
latefinal

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {ObjectCopyState? state, CustomResourceOptions? options}) → ObjectCopy
Gets an existing ObjectCopy resource's state with the given name and id.