UNPKG

@pulumi/aws

Version:

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

107 lines 4.56 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.AccessPointPolicy = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a resource to manage an S3 Access Point resource policy. * * > **NOTE on Access Points and Access Point Policies:** The provider provides both a standalone Access Point Policy resource and an Access Point resource with a resource policy defined in-line. You cannot use an Access Point with in-line resource policy in conjunction with an Access Point Policy resource. Doing so will cause a conflict of policies and will overwrite the access point's resource policy. * * ## 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 exampleAccessPoint = new aws.s3.AccessPoint("example", { * bucket: example.id, * name: "example", * publicAccessBlockConfiguration: { * blockPublicAcls: true, * blockPublicPolicy: false, * ignorePublicAcls: true, * restrictPublicBuckets: false, * }, * }); * const exampleAccessPointPolicy = new aws.s3control.AccessPointPolicy("example", { * accessPointArn: exampleAccessPoint.arn, * policy: pulumi.jsonStringify({ * Version: "2008-10-17", * Statement: [{ * Effect: "Allow", * Action: "s3:GetObjectTagging", * Principal: { * AWS: "*", * }, * Resource: pulumi.interpolate`${exampleAccessPoint.arn}/object/*`, * }], * }), * }); * ``` * * ## Import * * Using `pulumi import`, import Access Point policies using the `access_point_arn`. For example: * * ```sh * $ pulumi import aws:s3control/accessPointPolicy:AccessPointPolicy example arn:aws:s3:us-west-2:123456789012:accesspoint/example * ``` */ class AccessPointPolicy extends pulumi.CustomResource { /** * Get an existing AccessPointPolicy 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 AccessPointPolicy(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of AccessPointPolicy. 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'] === AccessPointPolicy.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["accessPointArn"] = state?.accessPointArn; resourceInputs["hasPublicAccessPolicy"] = state?.hasPublicAccessPolicy; resourceInputs["policy"] = state?.policy; resourceInputs["region"] = state?.region; } else { const args = argsOrState; if (args?.accessPointArn === undefined && !opts.urn) { throw new Error("Missing required property 'accessPointArn'"); } if (args?.policy === undefined && !opts.urn) { throw new Error("Missing required property 'policy'"); } resourceInputs["accessPointArn"] = args?.accessPointArn; resourceInputs["policy"] = args?.policy; resourceInputs["region"] = args?.region; resourceInputs["hasPublicAccessPolicy"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(AccessPointPolicy.__pulumiType, name, resourceInputs, opts); } } exports.AccessPointPolicy = AccessPointPolicy; /** @internal */ AccessPointPolicy.__pulumiType = 'aws:s3control/accessPointPolicy:AccessPointPolicy'; //# sourceMappingURL=accessPointPolicy.js.map