@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
208 lines • 11.3 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.ObjectCopy = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a resource for copying an S3 object.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const test = new aws.s3.ObjectCopy("test", {
* bucket: "destination_bucket",
* key: "destination_key",
* source: "source_bucket/source_key",
* grants: [{
* uri: "http://acs.amazonaws.com/groups/global/AllUsers",
* type: "Group",
* permissions: ["READ"],
* }],
* });
* ```
*
* ### 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`.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const test = new aws.s3.ObjectCopy("test", {
* bucket: "destination_bucket",
* key: "destination_key",
* source: "source_bucket/source_key",
* overrideProvider: {
* defaultTags: {
* tags: {},
* },
* },
* });
* ```
*/
class ObjectCopy extends pulumi.CustomResource {
/**
* Get an existing ObjectCopy resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new ObjectCopy(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of ObjectCopy. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === ObjectCopy.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["acl"] = state?.acl;
resourceInputs["arn"] = state?.arn;
resourceInputs["bucket"] = state?.bucket;
resourceInputs["bucketKeyEnabled"] = state?.bucketKeyEnabled;
resourceInputs["cacheControl"] = state?.cacheControl;
resourceInputs["checksumAlgorithm"] = state?.checksumAlgorithm;
resourceInputs["checksumCrc32"] = state?.checksumCrc32;
resourceInputs["checksumCrc32c"] = state?.checksumCrc32c;
resourceInputs["checksumCrc64nvme"] = state?.checksumCrc64nvme;
resourceInputs["checksumSha1"] = state?.checksumSha1;
resourceInputs["checksumSha256"] = state?.checksumSha256;
resourceInputs["contentDisposition"] = state?.contentDisposition;
resourceInputs["contentEncoding"] = state?.contentEncoding;
resourceInputs["contentLanguage"] = state?.contentLanguage;
resourceInputs["contentType"] = state?.contentType;
resourceInputs["copyIfMatch"] = state?.copyIfMatch;
resourceInputs["copyIfModifiedSince"] = state?.copyIfModifiedSince;
resourceInputs["copyIfNoneMatch"] = state?.copyIfNoneMatch;
resourceInputs["copyIfUnmodifiedSince"] = state?.copyIfUnmodifiedSince;
resourceInputs["customerAlgorithm"] = state?.customerAlgorithm;
resourceInputs["customerKey"] = state?.customerKey;
resourceInputs["customerKeyMd5"] = state?.customerKeyMd5;
resourceInputs["etag"] = state?.etag;
resourceInputs["expectedBucketOwner"] = state?.expectedBucketOwner;
resourceInputs["expectedSourceBucketOwner"] = state?.expectedSourceBucketOwner;
resourceInputs["expiration"] = state?.expiration;
resourceInputs["expires"] = state?.expires;
resourceInputs["forceDestroy"] = state?.forceDestroy;
resourceInputs["grants"] = state?.grants;
resourceInputs["key"] = state?.key;
resourceInputs["kmsEncryptionContext"] = state?.kmsEncryptionContext;
resourceInputs["kmsKeyId"] = state?.kmsKeyId;
resourceInputs["lastModified"] = state?.lastModified;
resourceInputs["metadata"] = state?.metadata;
resourceInputs["metadataDirective"] = state?.metadataDirective;
resourceInputs["objectLockLegalHoldStatus"] = state?.objectLockLegalHoldStatus;
resourceInputs["objectLockMode"] = state?.objectLockMode;
resourceInputs["objectLockRetainUntilDate"] = state?.objectLockRetainUntilDate;
resourceInputs["overrideProvider"] = state?.overrideProvider;
resourceInputs["region"] = state?.region;
resourceInputs["requestCharged"] = state?.requestCharged;
resourceInputs["requestPayer"] = state?.requestPayer;
resourceInputs["serverSideEncryption"] = state?.serverSideEncryption;
resourceInputs["source"] = state?.source;
resourceInputs["sourceCustomerAlgorithm"] = state?.sourceCustomerAlgorithm;
resourceInputs["sourceCustomerKey"] = state?.sourceCustomerKey;
resourceInputs["sourceCustomerKeyMd5"] = state?.sourceCustomerKeyMd5;
resourceInputs["sourceVersionId"] = state?.sourceVersionId;
resourceInputs["storageClass"] = state?.storageClass;
resourceInputs["taggingDirective"] = state?.taggingDirective;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["versionId"] = state?.versionId;
resourceInputs["websiteRedirect"] = state?.websiteRedirect;
}
else {
const args = argsOrState;
if (args?.bucket === undefined && !opts.urn) {
throw new Error("Missing required property 'bucket'");
}
if (args?.key === undefined && !opts.urn) {
throw new Error("Missing required property 'key'");
}
if (args?.source === undefined && !opts.urn) {
throw new Error("Missing required property 'source'");
}
resourceInputs["acl"] = args?.acl;
resourceInputs["bucket"] = args?.bucket;
resourceInputs["bucketKeyEnabled"] = args?.bucketKeyEnabled;
resourceInputs["cacheControl"] = args?.cacheControl;
resourceInputs["checksumAlgorithm"] = args?.checksumAlgorithm;
resourceInputs["contentDisposition"] = args?.contentDisposition;
resourceInputs["contentEncoding"] = args?.contentEncoding;
resourceInputs["contentLanguage"] = args?.contentLanguage;
resourceInputs["contentType"] = args?.contentType;
resourceInputs["copyIfMatch"] = args?.copyIfMatch;
resourceInputs["copyIfModifiedSince"] = args?.copyIfModifiedSince;
resourceInputs["copyIfNoneMatch"] = args?.copyIfNoneMatch;
resourceInputs["copyIfUnmodifiedSince"] = args?.copyIfUnmodifiedSince;
resourceInputs["customerAlgorithm"] = args?.customerAlgorithm;
resourceInputs["customerKey"] = args?.customerKey ? pulumi.secret(args.customerKey) : undefined;
resourceInputs["customerKeyMd5"] = args?.customerKeyMd5;
resourceInputs["expectedBucketOwner"] = args?.expectedBucketOwner;
resourceInputs["expectedSourceBucketOwner"] = args?.expectedSourceBucketOwner;
resourceInputs["expires"] = args?.expires;
resourceInputs["forceDestroy"] = args?.forceDestroy;
resourceInputs["grants"] = args?.grants;
resourceInputs["key"] = args?.key;
resourceInputs["kmsEncryptionContext"] = args?.kmsEncryptionContext ? pulumi.secret(args.kmsEncryptionContext) : undefined;
resourceInputs["kmsKeyId"] = args?.kmsKeyId ? pulumi.secret(args.kmsKeyId) : undefined;
resourceInputs["metadata"] = args?.metadata;
resourceInputs["metadataDirective"] = args?.metadataDirective;
resourceInputs["objectLockLegalHoldStatus"] = args?.objectLockLegalHoldStatus;
resourceInputs["objectLockMode"] = args?.objectLockMode;
resourceInputs["objectLockRetainUntilDate"] = args?.objectLockRetainUntilDate;
resourceInputs["overrideProvider"] = args?.overrideProvider;
resourceInputs["region"] = args?.region;
resourceInputs["requestPayer"] = args?.requestPayer;
resourceInputs["serverSideEncryption"] = args?.serverSideEncryption;
resourceInputs["source"] = args?.source;
resourceInputs["sourceCustomerAlgorithm"] = args?.sourceCustomerAlgorithm;
resourceInputs["sourceCustomerKey"] = args?.sourceCustomerKey ? pulumi.secret(args.sourceCustomerKey) : undefined;
resourceInputs["sourceCustomerKeyMd5"] = args?.sourceCustomerKeyMd5;
resourceInputs["storageClass"] = args?.storageClass;
resourceInputs["taggingDirective"] = args?.taggingDirective;
resourceInputs["tags"] = args?.tags;
resourceInputs["websiteRedirect"] = args?.websiteRedirect;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["checksumCrc32"] = undefined /*out*/;
resourceInputs["checksumCrc32c"] = undefined /*out*/;
resourceInputs["checksumCrc64nvme"] = undefined /*out*/;
resourceInputs["checksumSha1"] = undefined /*out*/;
resourceInputs["checksumSha256"] = undefined /*out*/;
resourceInputs["etag"] = undefined /*out*/;
resourceInputs["expiration"] = undefined /*out*/;
resourceInputs["lastModified"] = undefined /*out*/;
resourceInputs["requestCharged"] = undefined /*out*/;
resourceInputs["sourceVersionId"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
resourceInputs["versionId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["customerKey", "kmsEncryptionContext", "kmsKeyId", "sourceCustomerKey"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(ObjectCopy.__pulumiType, name, resourceInputs, opts);
}
}
exports.ObjectCopy = ObjectCopy;
/** @internal */
ObjectCopy.__pulumiType = 'aws:s3/objectCopy:ObjectCopy';
//# sourceMappingURL=objectCopy.js.map