UNPKG

@pulumi/aws

Version:

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

98 lines 3.66 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.VpcEndpointPolicy = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a VPC Endpoint Policy resource. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = aws.ec2.getVpcEndpointService({ * service: "dynamodb", * }); * const exampleVpc = new aws.ec2.Vpc("example", {cidrBlock: "10.0.0.0/16"}); * const exampleVpcEndpoint = new aws.ec2.VpcEndpoint("example", { * serviceName: example.then(example => example.serviceName), * vpcId: exampleVpc.id, * }); * const exampleVpcEndpointPolicy = new aws.ec2.VpcEndpointPolicy("example", { * vpcEndpointId: exampleVpcEndpoint.id, * policy: JSON.stringify({ * Version: "2012-10-17", * Statement: [{ * Sid: "AllowAll", * Effect: "Allow", * Principal: { * AWS: "*", * }, * Action: ["dynamodb:*"], * Resource: "*", * }], * }), * }); * ``` * * ## Import * * Using `pulumi import`, import VPC Endpoint Policies using the `id`. For example: * * ```sh * $ pulumi import aws:ec2/vpcEndpointPolicy:VpcEndpointPolicy example vpce-3ecf2a57 * ``` */ class VpcEndpointPolicy extends pulumi.CustomResource { /** * Get an existing VpcEndpointPolicy 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 VpcEndpointPolicy(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of VpcEndpointPolicy. 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'] === VpcEndpointPolicy.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["policy"] = state?.policy; resourceInputs["region"] = state?.region; resourceInputs["vpcEndpointId"] = state?.vpcEndpointId; } else { const args = argsOrState; if (args?.vpcEndpointId === undefined && !opts.urn) { throw new Error("Missing required property 'vpcEndpointId'"); } resourceInputs["policy"] = args?.policy; resourceInputs["region"] = args?.region; resourceInputs["vpcEndpointId"] = args?.vpcEndpointId; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(VpcEndpointPolicy.__pulumiType, name, resourceInputs, opts); } } exports.VpcEndpointPolicy = VpcEndpointPolicy; /** @internal */ VpcEndpointPolicy.__pulumiType = 'aws:ec2/vpcEndpointPolicy:VpcEndpointPolicy'; //# sourceMappingURL=vpcEndpointPolicy.js.map