UNPKG

@pulumi/aws

Version:

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

83 lines 3.86 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.VpcEndpointServiceAllowedPrinciple = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a resource to allow a principal to discover a VPC endpoint service. * * > **NOTE on VPC Endpoint Services and VPC Endpoint Service Allowed Principals:** This provider provides * both a standalone VPC Endpoint Service Allowed Principal resource * and a VPC Endpoint Service resource with an `allowedPrincipals` attribute. Do not use the same principal ARN in both * a VPC Endpoint Service resource and a VPC Endpoint Service Allowed Principal resource. Doing so will cause a conflict * and will overwrite the association. * * ## Example Usage * * Basic usage: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const current = aws.getCallerIdentity({}); * const allowMeToFoo = new aws.ec2.VpcEndpointServiceAllowedPrinciple("allow_me_to_foo", { * vpcEndpointServiceId: foo.id, * principalArn: current.then(current => current.arn), * }); * ``` */ class VpcEndpointServiceAllowedPrinciple extends pulumi.CustomResource { /** * Get an existing VpcEndpointServiceAllowedPrinciple 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 VpcEndpointServiceAllowedPrinciple(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of VpcEndpointServiceAllowedPrinciple. 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'] === VpcEndpointServiceAllowedPrinciple.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["principalArn"] = state?.principalArn; resourceInputs["region"] = state?.region; resourceInputs["vpcEndpointServiceId"] = state?.vpcEndpointServiceId; } else { const args = argsOrState; if (args?.principalArn === undefined && !opts.urn) { throw new Error("Missing required property 'principalArn'"); } if (args?.vpcEndpointServiceId === undefined && !opts.urn) { throw new Error("Missing required property 'vpcEndpointServiceId'"); } resourceInputs["principalArn"] = args?.principalArn; resourceInputs["region"] = args?.region; resourceInputs["vpcEndpointServiceId"] = args?.vpcEndpointServiceId; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(VpcEndpointServiceAllowedPrinciple.__pulumiType, name, resourceInputs, opts); } } exports.VpcEndpointServiceAllowedPrinciple = VpcEndpointServiceAllowedPrinciple; /** @internal */ VpcEndpointServiceAllowedPrinciple.__pulumiType = 'aws:ec2/vpcEndpointServiceAllowedPrinciple:VpcEndpointServiceAllowedPrinciple'; //# sourceMappingURL=vpcEndpointServiceAllowedPrinciple.js.map