@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
208 lines • 13.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, Object.assign(Object.assign({}, 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 ? state.acl : undefined;
resourceInputs["arn"] = state ? state.arn : undefined;
resourceInputs["bucket"] = state ? state.bucket : undefined;
resourceInputs["bucketKeyEnabled"] = state ? state.bucketKeyEnabled : undefined;
resourceInputs["cacheControl"] = state ? state.cacheControl : undefined;
resourceInputs["checksumAlgorithm"] = state ? state.checksumAlgorithm : undefined;
resourceInputs["checksumCrc32"] = state ? state.checksumCrc32 : undefined;
resourceInputs["checksumCrc32c"] = state ? state.checksumCrc32c : undefined;
resourceInputs["checksumCrc64nvme"] = state ? state.checksumCrc64nvme : undefined;
resourceInputs["checksumSha1"] = state ? state.checksumSha1 : undefined;
resourceInputs["checksumSha256"] = state ? state.checksumSha256 : undefined;
resourceInputs["contentDisposition"] = state ? state.contentDisposition : undefined;
resourceInputs["contentEncoding"] = state ? state.contentEncoding : undefined;
resourceInputs["contentLanguage"] = state ? state.contentLanguage : undefined;
resourceInputs["contentType"] = state ? state.contentType : undefined;
resourceInputs["copyIfMatch"] = state ? state.copyIfMatch : undefined;
resourceInputs["copyIfModifiedSince"] = state ? state.copyIfModifiedSince : undefined;
resourceInputs["copyIfNoneMatch"] = state ? state.copyIfNoneMatch : undefined;
resourceInputs["copyIfUnmodifiedSince"] = state ? state.copyIfUnmodifiedSince : undefined;
resourceInputs["customerAlgorithm"] = state ? state.customerAlgorithm : undefined;
resourceInputs["customerKey"] = state ? state.customerKey : undefined;
resourceInputs["customerKeyMd5"] = state ? state.customerKeyMd5 : undefined;
resourceInputs["etag"] = state ? state.etag : undefined;
resourceInputs["expectedBucketOwner"] = state ? state.expectedBucketOwner : undefined;
resourceInputs["expectedSourceBucketOwner"] = state ? state.expectedSourceBucketOwner : undefined;
resourceInputs["expiration"] = state ? state.expiration : undefined;
resourceInputs["expires"] = state ? state.expires : undefined;
resourceInputs["forceDestroy"] = state ? state.forceDestroy : undefined;
resourceInputs["grants"] = state ? state.grants : undefined;
resourceInputs["key"] = state ? state.key : undefined;
resourceInputs["kmsEncryptionContext"] = state ? state.kmsEncryptionContext : undefined;
resourceInputs["kmsKeyId"] = state ? state.kmsKeyId : undefined;
resourceInputs["lastModified"] = state ? state.lastModified : undefined;
resourceInputs["metadata"] = state ? state.metadata : undefined;
resourceInputs["metadataDirective"] = state ? state.metadataDirective : undefined;
resourceInputs["objectLockLegalHoldStatus"] = state ? state.objectLockLegalHoldStatus : undefined;
resourceInputs["objectLockMode"] = state ? state.objectLockMode : undefined;
resourceInputs["objectLockRetainUntilDate"] = state ? state.objectLockRetainUntilDate : undefined;
resourceInputs["overrideProvider"] = state ? state.overrideProvider : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["requestCharged"] = state ? state.requestCharged : undefined;
resourceInputs["requestPayer"] = state ? state.requestPayer : undefined;
resourceInputs["serverSideEncryption"] = state ? state.serverSideEncryption : undefined;
resourceInputs["source"] = state ? state.source : undefined;
resourceInputs["sourceCustomerAlgorithm"] = state ? state.sourceCustomerAlgorithm : undefined;
resourceInputs["sourceCustomerKey"] = state ? state.sourceCustomerKey : undefined;
resourceInputs["sourceCustomerKeyMd5"] = state ? state.sourceCustomerKeyMd5 : undefined;
resourceInputs["sourceVersionId"] = state ? state.sourceVersionId : undefined;
resourceInputs["storageClass"] = state ? state.storageClass : undefined;
resourceInputs["taggingDirective"] = state ? state.taggingDirective : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["tagsAll"] = state ? state.tagsAll : undefined;
resourceInputs["versionId"] = state ? state.versionId : undefined;
resourceInputs["websiteRedirect"] = state ? state.websiteRedirect : undefined;
}
else {
const args = argsOrState;
if ((!args || args.bucket === undefined) && !opts.urn) {
throw new Error("Missing required property 'bucket'");
}
if ((!args || args.key === undefined) && !opts.urn) {
throw new Error("Missing required property 'key'");
}
if ((!args || args.source === undefined) && !opts.urn) {
throw new Error("Missing required property 'source'");
}
resourceInputs["acl"] = args ? args.acl : undefined;
resourceInputs["bucket"] = args ? args.bucket : undefined;
resourceInputs["bucketKeyEnabled"] = args ? args.bucketKeyEnabled : undefined;
resourceInputs["cacheControl"] = args ? args.cacheControl : undefined;
resourceInputs["checksumAlgorithm"] = args ? args.checksumAlgorithm : undefined;
resourceInputs["contentDisposition"] = args ? args.contentDisposition : undefined;
resourceInputs["contentEncoding"] = args ? args.contentEncoding : undefined;
resourceInputs["contentLanguage"] = args ? args.contentLanguage : undefined;
resourceInputs["contentType"] = args ? args.contentType : undefined;
resourceInputs["copyIfMatch"] = args ? args.copyIfMatch : undefined;
resourceInputs["copyIfModifiedSince"] = args ? args.copyIfModifiedSince : undefined;
resourceInputs["copyIfNoneMatch"] = args ? args.copyIfNoneMatch : undefined;
resourceInputs["copyIfUnmodifiedSince"] = args ? args.copyIfUnmodifiedSince : undefined;
resourceInputs["customerAlgorithm"] = args ? args.customerAlgorithm : undefined;
resourceInputs["customerKey"] = (args === null || args === void 0 ? void 0 : args.customerKey) ? pulumi.secret(args.customerKey) : undefined;
resourceInputs["customerKeyMd5"] = args ? args.customerKeyMd5 : undefined;
resourceInputs["expectedBucketOwner"] = args ? args.expectedBucketOwner : undefined;
resourceInputs["expectedSourceBucketOwner"] = args ? args.expectedSourceBucketOwner : undefined;
resourceInputs["expires"] = args ? args.expires : undefined;
resourceInputs["forceDestroy"] = args ? args.forceDestroy : undefined;
resourceInputs["grants"] = args ? args.grants : undefined;
resourceInputs["key"] = args ? args.key : undefined;
resourceInputs["kmsEncryptionContext"] = (args === null || args === void 0 ? void 0 : args.kmsEncryptionContext) ? pulumi.secret(args.kmsEncryptionContext) : undefined;
resourceInputs["kmsKeyId"] = (args === null || args === void 0 ? void 0 : args.kmsKeyId) ? pulumi.secret(args.kmsKeyId) : undefined;
resourceInputs["metadata"] = args ? args.metadata : undefined;
resourceInputs["metadataDirective"] = args ? args.metadataDirective : undefined;
resourceInputs["objectLockLegalHoldStatus"] = args ? args.objectLockLegalHoldStatus : undefined;
resourceInputs["objectLockMode"] = args ? args.objectLockMode : undefined;
resourceInputs["objectLockRetainUntilDate"] = args ? args.objectLockRetainUntilDate : undefined;
resourceInputs["overrideProvider"] = args ? args.overrideProvider : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["requestPayer"] = args ? args.requestPayer : undefined;
resourceInputs["serverSideEncryption"] = args ? args.serverSideEncryption : undefined;
resourceInputs["source"] = args ? args.source : undefined;
resourceInputs["sourceCustomerAlgorithm"] = args ? args.sourceCustomerAlgorithm : undefined;
resourceInputs["sourceCustomerKey"] = (args === null || args === void 0 ? void 0 : args.sourceCustomerKey) ? pulumi.secret(args.sourceCustomerKey) : undefined;
resourceInputs["sourceCustomerKeyMd5"] = args ? args.sourceCustomerKeyMd5 : undefined;
resourceInputs["storageClass"] = args ? args.storageClass : undefined;
resourceInputs["taggingDirective"] = args ? args.taggingDirective : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["websiteRedirect"] = args ? args.websiteRedirect : undefined;
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