UNPKG

@pulumi/aws

Version:

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

112 lines 4.73 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.MultiRegionAccessPointPolicy = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a resource to manage an S3 Multi-Region Access Point access control policy. * * ## Example Usage * * ### Basic Example * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * import * as std from "@pulumi/std"; * * const current = aws.getCallerIdentity({}); * const currentGetPartition = aws.getPartition({}); * const fooBucket = new aws.s3.Bucket("foo_bucket", {bucket: "example-bucket-foo"}); * const example = new aws.s3control.MultiRegionAccessPoint("example", {details: { * name: "example", * regions: [{ * bucket: fooBucket.id, * }], * }}); * const exampleMultiRegionAccessPointPolicy = new aws.s3control.MultiRegionAccessPointPolicy("example", {details: { * name: std.splitOutput({ * separator: ":", * text: example.id, * }).apply(invoke => invoke.result)[1], * policy: pulumi.jsonStringify({ * Version: "2012-10-17", * Statement: [{ * Sid: "Example", * Effect: "Allow", * Principal: { * AWS: current.then(current => current.accountId), * }, * Action: [ * "s3:GetObject", * "s3:PutObject", * ], * Resource: pulumi.all([currentGetPartition, current, example.alias]).apply(([currentGetPartition, current, alias]) => `arn:${currentGetPartition.partition}:s3::${current.accountId}:accesspoint/${alias}/object/*`), * }], * }), * }}); * ``` * * ## Import * * Using `pulumi import`, import Multi-Region Access Point Policies using the `account_id` and `name` of the Multi-Region Access Point separated by a colon (`:`). For example: * * ```sh * $ pulumi import aws:s3control/multiRegionAccessPointPolicy:MultiRegionAccessPointPolicy example 123456789012:example * ``` */ class MultiRegionAccessPointPolicy extends pulumi.CustomResource { /** * Get an existing MultiRegionAccessPointPolicy 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 MultiRegionAccessPointPolicy(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of MultiRegionAccessPointPolicy. 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'] === MultiRegionAccessPointPolicy.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["accountId"] = state?.accountId; resourceInputs["details"] = state?.details; resourceInputs["established"] = state?.established; resourceInputs["proposed"] = state?.proposed; resourceInputs["region"] = state?.region; } else { const args = argsOrState; if (args?.details === undefined && !opts.urn) { throw new Error("Missing required property 'details'"); } resourceInputs["accountId"] = args?.accountId; resourceInputs["details"] = args?.details; resourceInputs["region"] = args?.region; resourceInputs["established"] = undefined /*out*/; resourceInputs["proposed"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(MultiRegionAccessPointPolicy.__pulumiType, name, resourceInputs, opts); } } exports.MultiRegionAccessPointPolicy = MultiRegionAccessPointPolicy; /** @internal */ MultiRegionAccessPointPolicy.__pulumiType = 'aws:s3control/multiRegionAccessPointPolicy:MultiRegionAccessPointPolicy'; //# sourceMappingURL=multiRegionAccessPointPolicy.js.map