Class ObjectCopy


  • public class ObjectCopy
    extends com.pulumi.resources.CustomResource
    Provides a resource for copying an S3 object. ## Example Usage
     
     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());
     
         }
     }
     
     
    ### Ignoring Provider `defaultTags` S3 objects support a [maximum of 10 tags](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-tagging.html). 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`.
     
     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());
     
         }
     }
     
     
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.lang.String> acl()  
      com.pulumi.core.Output<java.lang.String> arn()  
      com.pulumi.core.Output<java.lang.String> bucket()  
      com.pulumi.core.Output<java.lang.Boolean> bucketKeyEnabled()  
      com.pulumi.core.Output<java.lang.String> cacheControl()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> checksumAlgorithm()  
      com.pulumi.core.Output<java.lang.String> checksumCrc32()  
      com.pulumi.core.Output<java.lang.String> checksumCrc32c()  
      com.pulumi.core.Output<java.lang.String> checksumCrc64nvme()  
      com.pulumi.core.Output<java.lang.String> checksumSha1()  
      com.pulumi.core.Output<java.lang.String> checksumSha256()  
      com.pulumi.core.Output<java.lang.String> contentDisposition()  
      com.pulumi.core.Output<java.lang.String> contentEncoding()  
      com.pulumi.core.Output<java.lang.String> contentLanguage()  
      com.pulumi.core.Output<java.lang.String> contentType()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> copyIfMatch()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> copyIfModifiedSince()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> copyIfNoneMatch()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> copyIfUnmodifiedSince()  
      com.pulumi.core.Output<java.lang.String> customerAlgorithm()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> customerKey()  
      com.pulumi.core.Output<java.lang.String> customerKeyMd5()  
      com.pulumi.core.Output<java.lang.String> etag()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> expectedBucketOwner()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> expectedSourceBucketOwner()  
      com.pulumi.core.Output<java.lang.String> expiration()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> expires()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> forceDestroy()  
      static ObjectCopy get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, ObjectCopyState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.util.Optional<java.util.List<ObjectCopyGrant>>> grants()  
      com.pulumi.core.Output<java.lang.String> key()  
      com.pulumi.core.Output<java.lang.String> kmsEncryptionContext()  
      com.pulumi.core.Output<java.lang.String> kmsKeyId()  
      com.pulumi.core.Output<java.lang.String> lastModified()  
      com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> metadata()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> metadataDirective()  
      com.pulumi.core.Output<java.lang.String> objectLockLegalHoldStatus()  
      com.pulumi.core.Output<java.lang.String> objectLockMode()  
      com.pulumi.core.Output<java.lang.String> objectLockRetainUntilDate()  
      com.pulumi.core.Output<java.util.Optional<ObjectCopyOverrideProvider>> overrideProvider()  
      com.pulumi.core.Output<java.lang.String> region()  
      com.pulumi.core.Output<java.lang.Boolean> requestCharged()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> requestPayer()  
      com.pulumi.core.Output<java.lang.String> serverSideEncryption()  
      com.pulumi.core.Output<java.lang.String> source()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> sourceCustomerAlgorithm()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> sourceCustomerKey()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> sourceCustomerKeyMd5()  
      com.pulumi.core.Output<java.lang.String> sourceVersionId()  
      com.pulumi.core.Output<java.lang.String> storageClass()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> taggingDirective()  
      com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()  
      com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()  
      com.pulumi.core.Output<java.lang.String> versionId()  
      com.pulumi.core.Output<java.lang.String> websiteRedirect()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ObjectCopy

        public ObjectCopy​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • ObjectCopy

        public ObjectCopy​(java.lang.String name,
                          ObjectCopyArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • ObjectCopy

        public ObjectCopy​(java.lang.String name,
                          ObjectCopyArgs args,
                          @Nullable
                          com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • acl

        public com.pulumi.core.Output<java.lang.String> acl()
        Returns:
        [Canned ACL](https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#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`.
      • arn

        public com.pulumi.core.Output<java.lang.String> arn()
        Returns:
        ARN of the object.
      • bucket

        public com.pulumi.core.Output<java.lang.String> bucket()
        Returns:
        Name of the bucket to put the file in.
      • bucketKeyEnabled

        public com.pulumi.core.Output<java.lang.Boolean> bucketKeyEnabled()
        Returns:
        Whether to use an S3 Bucket Key for object encryption with server-side encryption using KMS (SSE-KMS).
      • cacheControl

        public com.pulumi.core.Output<java.lang.String> cacheControl()
        Returns:
        Caching behavior along the request/reply chain. Read [w3c cacheControl](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9) for further details.
      • checksumAlgorithm

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> checksumAlgorithm()
        Returns:
        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`.
      • checksumCrc32

        public com.pulumi.core.Output<java.lang.String> checksumCrc32()
        Returns:
        Base64-encoded, 32-bit CRC32 checksum of the object.
      • checksumCrc32c

        public com.pulumi.core.Output<java.lang.String> checksumCrc32c()
        Returns:
        Base64-encoded, 32-bit CRC32C checksum of the object.
      • checksumCrc64nvme

        public com.pulumi.core.Output<java.lang.String> checksumCrc64nvme()
        Returns:
        Base64-encoded, 64-bit CRC64NVME checksum of the object.
      • checksumSha1

        public com.pulumi.core.Output<java.lang.String> checksumSha1()
        Returns:
        Base64-encoded, 160-bit SHA-1 digest of the object.
      • checksumSha256

        public com.pulumi.core.Output<java.lang.String> checksumSha256()
        Returns:
        Base64-encoded, 256-bit SHA-256 digest of the object.
      • contentDisposition

        public com.pulumi.core.Output<java.lang.String> contentDisposition()
        Returns:
        Presentational information for the object. Read [w3c contentDisposition](http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1) for further information.
      • contentEncoding

        public com.pulumi.core.Output<java.lang.String> contentEncoding()
        Returns:
        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](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11) for further information.
      • contentLanguage

        public com.pulumi.core.Output<java.lang.String> contentLanguage()
        Returns:
        Language the content is in e.g., en-US or en-GB.
      • contentType

        public com.pulumi.core.Output<java.lang.String> contentType()
        Returns:
        Standard MIME type describing the format of the object data, e.g., `application/octet-stream`. All Valid MIME Types are valid for this input.
      • copyIfMatch

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> copyIfMatch()
        Returns:
        Copies the object if its entity tag (ETag) matches the specified tag.
      • copyIfModifiedSince

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> copyIfModifiedSince()
        Returns:
        Copies the object if it has been modified since the specified time, in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8).
      • copyIfNoneMatch

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> copyIfNoneMatch()
        Returns:
        Copies the object if its entity tag (ETag) is different than the specified ETag.
      • copyIfUnmodifiedSince

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> copyIfUnmodifiedSince()
        Returns:
        Copies the object if it hasn't been modified since the specified time, in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8).
      • customerAlgorithm

        public com.pulumi.core.Output<java.lang.String> customerAlgorithm()
        Returns:
        Algorithm to use when encrypting the object (for example, AES256).
      • customerKey

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> customerKey()
        Returns:
        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.
      • customerKeyMd5

        public com.pulumi.core.Output<java.lang.String> customerKeyMd5()
        Returns:
        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.
      • etag

        public com.pulumi.core.Output<java.lang.String> etag()
        Returns:
        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](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTCommonResponseHeaders.html).
      • expectedBucketOwner

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> expectedBucketOwner()
        Returns:
        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.
      • expectedSourceBucketOwner

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> expectedSourceBucketOwner()
        Returns:
        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.
      • expiration

        public com.pulumi.core.Output<java.lang.String> expiration()
        Returns:
        If the object expiration is configured, this attribute will be set.
      • expires

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> expires()
        Returns:
        Date and time at which the object is no longer cacheable, in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8).
      • forceDestroy

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> forceDestroy()
        Returns:
        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.
      • grants

        public com.pulumi.core.Output<java.util.Optional<java.util.List<ObjectCopyGrant>>> grants()
        Returns:
        Configuration block for header grants. Documented below. Conflicts with `acl`.
      • key

        public com.pulumi.core.Output<java.lang.String> key()
        Returns:
        Name of the object once it is in the bucket.
      • kmsEncryptionContext

        public com.pulumi.core.Output<java.lang.String> kmsEncryptionContext()
        Returns:
        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.
      • kmsKeyId

        public com.pulumi.core.Output<java.lang.String> kmsKeyId()
        Returns:
        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`
      • lastModified

        public com.pulumi.core.Output<java.lang.String> lastModified()
        Returns:
        Returns the date that the object was last modified, in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8).
      • metadata

        public com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> metadata()
        Returns:
        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).
      • metadataDirective

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> metadataDirective()
        Returns:
        Whether the metadata is copied from the source object or replaced with metadata provided in the request. Valid values are `COPY` and `REPLACE`.
      • objectLockLegalHoldStatus

        public com.pulumi.core.Output<java.lang.String> objectLockLegalHoldStatus()
        Returns:
        [Legal hold](https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock-overview.html#object-lock-legal-holds) status to apply to the specified object. Valid values are `ON` and `OFF`.
      • objectLockMode

        public com.pulumi.core.Output<java.lang.String> objectLockMode()
        Returns:
        Object lock [retention mode](https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock-overview.html#object-lock-retention-modes) that you want to apply to this object. Valid values are `GOVERNANCE` and `COMPLIANCE`.
      • objectLockRetainUntilDate

        public com.pulumi.core.Output<java.lang.String> objectLockRetainUntilDate()
        Returns:
        Date and time, in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8), when this object's object lock will [expire](https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock-overview.html#object-lock-retention-periods).
      • region

        public com.pulumi.core.Output<java.lang.String> region()
        Returns:
        Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
      • requestCharged

        public com.pulumi.core.Output<java.lang.Boolean> requestCharged()
        Returns:
        If present, indicates that the requester was successfully charged for the request.
      • requestPayer

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> requestPayer()
        Returns:
        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`.
      • serverSideEncryption

        public com.pulumi.core.Output<java.lang.String> serverSideEncryption()
        Returns:
        Server-side encryption of the object in S3. Valid values are `AES256` and `aws:kms`.
      • source

        public com.pulumi.core.Output<java.lang.String> source()
        Returns:
        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:<Region>:<account-id>:accesspoint/<access-point-name>/object/<key>`. For example, `arn:aws:s3:us-west-2:9999912999:accesspoint/my-access-point/object/testbucket/test1.json`. The following arguments are optional:
      • sourceCustomerAlgorithm

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> sourceCustomerAlgorithm()
        Returns:
        Algorithm to use when decrypting the source object (for example, AES256).
      • sourceCustomerKey

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> sourceCustomerKey()
        Returns:
        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.
      • sourceCustomerKeyMd5

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> sourceCustomerKeyMd5()
        Returns:
        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.
      • sourceVersionId

        public com.pulumi.core.Output<java.lang.String> sourceVersionId()
        Returns:
        Version of the copied object in the source bucket.
      • storageClass

        public com.pulumi.core.Output<java.lang.String> storageClass()
        Returns:
        Desired [storage class](https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html#AmazonS3-CopyObject-request-header-StorageClass) for the object. Defaults to `STANDARD`.
      • taggingDirective

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> taggingDirective()
        Returns:
        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`.
      • tags

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()
        Returns:
        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.
      • tagsAll

        public com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()
        Returns:
        Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
      • versionId

        public com.pulumi.core.Output<java.lang.String> versionId()
        Returns:
        Version ID of the newly created copy.
      • websiteRedirect

        public com.pulumi.core.Output<java.lang.String> websiteRedirect()
        Returns:
        Target URL for [website redirect](http://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html).
      • get

        public static ObjectCopy get​(java.lang.String name,
                                     com.pulumi.core.Output<java.lang.String> id,
                                     @Nullable
                                     ObjectCopyState state,
                                     @Nullable
                                     com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.