UNPKG

@pulumi/aws

Version:

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

90 lines 3.92 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.VpcEndpointSubnetAssociation = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a resource to create an association between a VPC endpoint and a subnet. * * > **NOTE on VPC Endpoints and VPC Endpoint Subnet Associations:** This provider provides * both a standalone VPC Endpoint Subnet Association (an association between a VPC endpoint * and a single `subnetId`) and a VPC Endpoint resource with a `subnetIds` * attribute. Do not use the same subnet ID in both a VPC Endpoint resource and a VPC Endpoint Subnet * Association resource. Doing so will cause a conflict of associations and will overwrite the association. * * ## Example Usage * * Basic usage: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const snEc2 = new aws.ec2.VpcEndpointSubnetAssociation("sn_ec2", { * vpcEndpointId: ec2.id, * subnetId: sn.id, * }); * ``` * * ## Import * * Using `pulumi import`, import VPC Endpoint Subnet Associations using `vpc_endpoint_id` together with `subnet_id`. For example: * * ```sh * $ pulumi import aws:ec2/vpcEndpointSubnetAssociation:VpcEndpointSubnetAssociation example vpce-aaaaaaaa/subnet-bbbbbbbbbbbbbbbbb * ``` */ class VpcEndpointSubnetAssociation extends pulumi.CustomResource { /** * Get an existing VpcEndpointSubnetAssociation 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 VpcEndpointSubnetAssociation(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of VpcEndpointSubnetAssociation. 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'] === VpcEndpointSubnetAssociation.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["region"] = state?.region; resourceInputs["subnetId"] = state?.subnetId; resourceInputs["vpcEndpointId"] = state?.vpcEndpointId; } else { const args = argsOrState; if (args?.subnetId === undefined && !opts.urn) { throw new Error("Missing required property 'subnetId'"); } if (args?.vpcEndpointId === undefined && !opts.urn) { throw new Error("Missing required property 'vpcEndpointId'"); } resourceInputs["region"] = args?.region; resourceInputs["subnetId"] = args?.subnetId; resourceInputs["vpcEndpointId"] = args?.vpcEndpointId; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(VpcEndpointSubnetAssociation.__pulumiType, name, resourceInputs, opts); } } exports.VpcEndpointSubnetAssociation = VpcEndpointSubnetAssociation; /** @internal */ VpcEndpointSubnetAssociation.__pulumiType = 'aws:ec2/vpcEndpointSubnetAssociation:VpcEndpointSubnetAssociation'; //# sourceMappingURL=vpcEndpointSubnetAssociation.js.map