@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
87 lines • 3.54 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.BucketOwnershipControls = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a resource to manage S3 Bucket Ownership Controls. For more information, see the [S3 Developer Guide](https://docs.aws.amazon.com/AmazonS3/latest/dev/about-object-ownership.html).
*
* > This resource cannot be used with S3 directory buckets.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.s3.Bucket("example", {bucket: "example"});
* const exampleBucketOwnershipControls = new aws.s3.BucketOwnershipControls("example", {
* bucket: example.id,
* rule: {
* objectOwnership: "BucketOwnerPreferred",
* },
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import S3 Bucket Ownership Controls using S3 Bucket name. For example:
*
* ```sh
* $ pulumi import aws:s3/bucketOwnershipControls:BucketOwnershipControls example my-bucket
* ```
*/
class BucketOwnershipControls extends pulumi.CustomResource {
/**
* Get an existing BucketOwnershipControls 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 BucketOwnershipControls(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of BucketOwnershipControls. 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'] === BucketOwnershipControls.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["bucket"] = state?.bucket;
resourceInputs["region"] = state?.region;
resourceInputs["rule"] = state?.rule;
}
else {
const args = argsOrState;
if (args?.bucket === undefined && !opts.urn) {
throw new Error("Missing required property 'bucket'");
}
if (args?.rule === undefined && !opts.urn) {
throw new Error("Missing required property 'rule'");
}
resourceInputs["bucket"] = args?.bucket;
resourceInputs["region"] = args?.region;
resourceInputs["rule"] = args?.rule;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(BucketOwnershipControls.__pulumiType, name, resourceInputs, opts);
}
}
exports.BucketOwnershipControls = BucketOwnershipControls;
/** @internal */
BucketOwnershipControls.__pulumiType = 'aws:s3/bucketOwnershipControls:BucketOwnershipControls';
//# sourceMappingURL=bucketOwnershipControls.js.map
;