UNPKG

@pulumi/aws

Version:

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

112 lines 4.61 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.ObjectLambdaAccessPointPolicy = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a resource to manage an S3 Object Lambda Access Point 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", * }); * const exampleObjectLambdaAccessPoint = new aws.s3control.ObjectLambdaAccessPoint("example", { * name: "example", * configuration: { * supportingAccessPoint: exampleAccessPoint.arn, * transformationConfigurations: [{ * actions: ["GetObject"], * contentTransformation: { * awsLambda: { * functionArn: exampleAwsLambdaFunction.arn, * }, * }, * }], * }, * }); * const exampleObjectLambdaAccessPointPolicy = new aws.s3control.ObjectLambdaAccessPointPolicy("example", { * name: exampleObjectLambdaAccessPoint.name, * policy: pulumi.jsonStringify({ * Version: "2008-10-17", * Statement: [{ * Effect: "Allow", * Action: "s3-object-lambda:GetObject", * Principal: { * AWS: current.accountId, * }, * Resource: exampleObjectLambdaAccessPoint.arn, * }], * }), * }); * ``` * * ## Import * * Using `pulumi import`, import Object Lambda Access Point policies using the `account_id` and `name`, separated by a colon (`:`). For example: * * ```sh * $ pulumi import aws:s3control/objectLambdaAccessPointPolicy:ObjectLambdaAccessPointPolicy example 123456789012:example * ``` */ class ObjectLambdaAccessPointPolicy extends pulumi.CustomResource { /** * Get an existing ObjectLambdaAccessPointPolicy 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 ObjectLambdaAccessPointPolicy(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of ObjectLambdaAccessPointPolicy. 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'] === ObjectLambdaAccessPointPolicy.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["accountId"] = state?.accountId; resourceInputs["hasPublicAccessPolicy"] = state?.hasPublicAccessPolicy; resourceInputs["name"] = state?.name; resourceInputs["policy"] = state?.policy; resourceInputs["region"] = state?.region; } else { const args = argsOrState; if (args?.policy === undefined && !opts.urn) { throw new Error("Missing required property 'policy'"); } resourceInputs["accountId"] = args?.accountId; resourceInputs["name"] = args?.name; resourceInputs["policy"] = args?.policy; resourceInputs["region"] = args?.region; resourceInputs["hasPublicAccessPolicy"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ObjectLambdaAccessPointPolicy.__pulumiType, name, resourceInputs, opts); } } exports.ObjectLambdaAccessPointPolicy = ObjectLambdaAccessPointPolicy; /** @internal */ ObjectLambdaAccessPointPolicy.__pulumiType = 'aws:s3control/objectLambdaAccessPointPolicy:ObjectLambdaAccessPointPolicy'; //# sourceMappingURL=objectLambdaAccessPointPolicy.js.map