UNPKG

@pulumi/aws

Version:

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

240 lines • 10.3 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.VpcEndpoint = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a VPC Endpoint resource. * * > **NOTE on VPC Endpoints and VPC Endpoint Associations:** The provider provides both standalone VPC Endpoint Associations for * Route Tables - (an association between a VPC endpoint and a single `routeTableId`), * Security Groups - (an association between a VPC endpoint and a single `securityGroupId`), * and Subnets - (an association between a VPC endpoint and a single `subnetId`) and * a VPC Endpoint resource with `routeTableIds` and `subnetIds` attributes. * Do not use the same resource ID in both a VPC Endpoint resource and a VPC Endpoint Association resource. * Doing so will cause a conflict of associations and will overwrite the association. * * ## Example Usage * * ### Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const s3 = new aws.ec2.VpcEndpoint("s3", { * vpcId: main.id, * serviceName: "com.amazonaws.us-west-2.s3", * }); * ``` * * ### Basic w/ Tags * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const s3 = new aws.ec2.VpcEndpoint("s3", { * vpcId: main.id, * serviceName: "com.amazonaws.us-west-2.s3", * tags: { * Environment: "test", * }, * }); * ``` * * ### Interface Endpoint Type * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const ec2 = new aws.ec2.VpcEndpoint("ec2", { * vpcId: main.id, * serviceName: "com.amazonaws.us-west-2.ec2", * vpcEndpointType: "Interface", * securityGroupIds: [sg1.id], * privateDnsEnabled: true, * }); * ``` * * ### Interface Endpoint Type with User-Defined IP Address * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const ec2 = new aws.ec2.VpcEndpoint("ec2", { * vpcId: example.id, * serviceName: "com.amazonaws.us-west-2.ec2", * vpcEndpointType: "Interface", * subnetConfigurations: [ * { * ipv4: "10.0.1.10", * subnetId: example1.id, * }, * { * ipv4: "10.0.2.10", * subnetId: example2.id, * }, * ], * subnetIds: [ * example1.id, * example2.id, * ], * }); * ``` * * ### Gateway Load Balancer Endpoint Type * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const current = aws.getCallerIdentity({}); * const example = new aws.ec2.VpcEndpointService("example", { * acceptanceRequired: false, * allowedPrincipals: [current.then(current => current.arn)], * gatewayLoadBalancerArns: [exampleAwsLb.arn], * }); * const exampleVpcEndpoint = new aws.ec2.VpcEndpoint("example", { * serviceName: example.serviceName, * subnetIds: [exampleAwsSubnet.id], * vpcEndpointType: example.serviceType, * vpcId: exampleAwsVpc.id, * }); * ``` * * ### VPC Lattice Resource Configuration Endpoint Type * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.ec2.VpcEndpoint("example", { * resourceConfigurationArn: exampleAwsVpclatticeResourceConfiguration.arn, * subnetIds: [exampleAwsSubnet.id], * vpcEndpointType: "Resource", * vpcId: exampleAwsVpc.id, * }); * ``` * * ### VPC Lattice Service Network Endpoint Type * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.ec2.VpcEndpoint("example", { * serviceNetworkArn: exampleAwsVpclatticeServiceNetwork.arn, * subnetIds: [exampleAwsSubnet.id], * vpcEndpointType: "ServiceNetwork", * vpcId: exampleAwsVpc.id, * }); * ``` * * ## Import * * Using `pulumi import`, import VPC Endpoints using the VPC endpoint `id`. For example: * * ```sh * $ pulumi import aws:ec2/vpcEndpoint:VpcEndpoint endpoint1 vpce-3ecf2a57 * ``` */ class VpcEndpoint extends pulumi.CustomResource { /** * Get an existing VpcEndpoint 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 VpcEndpoint(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of VpcEndpoint. 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'] === VpcEndpoint.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state ? state.arn : undefined; resourceInputs["autoAccept"] = state ? state.autoAccept : undefined; resourceInputs["cidrBlocks"] = state ? state.cidrBlocks : undefined; resourceInputs["dnsEntries"] = state ? state.dnsEntries : undefined; resourceInputs["dnsOptions"] = state ? state.dnsOptions : undefined; resourceInputs["ipAddressType"] = state ? state.ipAddressType : undefined; resourceInputs["networkInterfaceIds"] = state ? state.networkInterfaceIds : undefined; resourceInputs["ownerId"] = state ? state.ownerId : undefined; resourceInputs["policy"] = state ? state.policy : undefined; resourceInputs["prefixListId"] = state ? state.prefixListId : undefined; resourceInputs["privateDnsEnabled"] = state ? state.privateDnsEnabled : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["requesterManaged"] = state ? state.requesterManaged : undefined; resourceInputs["resourceConfigurationArn"] = state ? state.resourceConfigurationArn : undefined; resourceInputs["routeTableIds"] = state ? state.routeTableIds : undefined; resourceInputs["securityGroupIds"] = state ? state.securityGroupIds : undefined; resourceInputs["serviceName"] = state ? state.serviceName : undefined; resourceInputs["serviceNetworkArn"] = state ? state.serviceNetworkArn : undefined; resourceInputs["serviceRegion"] = state ? state.serviceRegion : undefined; resourceInputs["state"] = state ? state.state : undefined; resourceInputs["subnetConfigurations"] = state ? state.subnetConfigurations : undefined; resourceInputs["subnetIds"] = state ? state.subnetIds : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["tagsAll"] = state ? state.tagsAll : undefined; resourceInputs["vpcEndpointType"] = state ? state.vpcEndpointType : undefined; resourceInputs["vpcId"] = state ? state.vpcId : undefined; } else { const args = argsOrState; if ((!args || args.vpcId === undefined) && !opts.urn) { throw new Error("Missing required property 'vpcId'"); } resourceInputs["autoAccept"] = args ? args.autoAccept : undefined; resourceInputs["dnsOptions"] = args ? args.dnsOptions : undefined; resourceInputs["ipAddressType"] = args ? args.ipAddressType : undefined; resourceInputs["policy"] = args ? args.policy : undefined; resourceInputs["privateDnsEnabled"] = args ? args.privateDnsEnabled : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["resourceConfigurationArn"] = args ? args.resourceConfigurationArn : undefined; resourceInputs["routeTableIds"] = args ? args.routeTableIds : undefined; resourceInputs["securityGroupIds"] = args ? args.securityGroupIds : undefined; resourceInputs["serviceName"] = args ? args.serviceName : undefined; resourceInputs["serviceNetworkArn"] = args ? args.serviceNetworkArn : undefined; resourceInputs["serviceRegion"] = args ? args.serviceRegion : undefined; resourceInputs["subnetConfigurations"] = args ? args.subnetConfigurations : undefined; resourceInputs["subnetIds"] = args ? args.subnetIds : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["vpcEndpointType"] = args ? args.vpcEndpointType : undefined; resourceInputs["vpcId"] = args ? args.vpcId : undefined; resourceInputs["arn"] = undefined /*out*/; resourceInputs["cidrBlocks"] = undefined /*out*/; resourceInputs["dnsEntries"] = undefined /*out*/; resourceInputs["networkInterfaceIds"] = undefined /*out*/; resourceInputs["ownerId"] = undefined /*out*/; resourceInputs["prefixListId"] = undefined /*out*/; resourceInputs["requesterManaged"] = undefined /*out*/; resourceInputs["state"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(VpcEndpoint.__pulumiType, name, resourceInputs, opts); } } exports.VpcEndpoint = VpcEndpoint; /** @internal */ VpcEndpoint.__pulumiType = 'aws:ec2/vpcEndpoint:VpcEndpoint'; //# sourceMappingURL=vpcEndpoint.js.map