UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

96 lines 3.77 kB
"use strict"; // *** 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.BucketPolicy = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a resource to manage an S3 Control Bucket Policy. * * > This functionality is for managing [S3 on Outposts](https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html). To manage S3 Bucket Policies in an AWS Partition, see the `aws.s3.BucketPolicy` resource. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.s3control.BucketPolicy("example", { * bucket: exampleAwsS3controlBucket.arn, * policy: JSON.stringify({ * Id: "testBucketPolicy", * Statement: [{ * Action: "s3-outposts:PutBucketLifecycleConfiguration", * Effect: "Deny", * Principal: { * AWS: "*", * }, * Resource: exampleAwsS3controlBucket.arn, * Sid: "statement1", * }], * Version: "2012-10-17", * }), * }); * ``` * * ## Import * * Using `pulumi import`, import S3 Control Bucket Policies using the Amazon Resource Name (ARN). For example: * * ```sh * $ pulumi import aws:s3control/bucketPolicy:BucketPolicy example arn:aws:s3-outposts:us-east-1:123456789012:outpost/op-12345678/bucket/example * ``` */ class BucketPolicy extends pulumi.CustomResource { /** * Get an existing BucketPolicy 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 BucketPolicy(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of BucketPolicy. 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'] === BucketPolicy.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["bucket"] = state?.bucket; resourceInputs["policy"] = state?.policy; resourceInputs["region"] = state?.region; } else { const args = argsOrState; if (args?.bucket === undefined && !opts.urn) { throw new Error("Missing required property 'bucket'"); } if (args?.policy === undefined && !opts.urn) { throw new Error("Missing required property 'policy'"); } resourceInputs["bucket"] = args?.bucket; resourceInputs["policy"] = args?.policy; resourceInputs["region"] = args?.region; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(BucketPolicy.__pulumiType, name, resourceInputs, opts); } } exports.BucketPolicy = BucketPolicy; /** @internal */ BucketPolicy.__pulumiType = 'aws:s3control/bucketPolicy:BucketPolicy'; //# sourceMappingURL=bucketPolicy.js.map