@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
108 lines • 5.22 kB
JavaScript
// *** 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.VpcAttachment = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages an EC2 Transit Gateway VPC Attachment. For examples of custom route table association and propagation, see the EC2 Transit Gateway Networking Examples Guide.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.ec2transitgateway.VpcAttachment("example", {
* subnetIds: [exampleAwsSubnet.id],
* transitGatewayId: exampleAwsEc2TransitGateway.id,
* vpcId: exampleAwsVpc.id,
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import `aws_ec2_transit_gateway_vpc_attachment` using the EC2 Transit Gateway Attachment identifier. For example:
*
* ```sh
* $ pulumi import aws:ec2transitgateway/vpcAttachment:VpcAttachment example tgw-attach-12345678
* ```
*/
class VpcAttachment extends pulumi.CustomResource {
/**
* Get an existing VpcAttachment 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 VpcAttachment(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of VpcAttachment. 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'] === VpcAttachment.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["applianceModeSupport"] = state?.applianceModeSupport;
resourceInputs["arn"] = state?.arn;
resourceInputs["dnsSupport"] = state?.dnsSupport;
resourceInputs["ipv6Support"] = state?.ipv6Support;
resourceInputs["region"] = state?.region;
resourceInputs["securityGroupReferencingSupport"] = state?.securityGroupReferencingSupport;
resourceInputs["subnetIds"] = state?.subnetIds;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["transitGatewayDefaultRouteTableAssociation"] = state?.transitGatewayDefaultRouteTableAssociation;
resourceInputs["transitGatewayDefaultRouteTablePropagation"] = state?.transitGatewayDefaultRouteTablePropagation;
resourceInputs["transitGatewayId"] = state?.transitGatewayId;
resourceInputs["vpcId"] = state?.vpcId;
resourceInputs["vpcOwnerId"] = state?.vpcOwnerId;
}
else {
const args = argsOrState;
if (args?.subnetIds === undefined && !opts.urn) {
throw new Error("Missing required property 'subnetIds'");
}
if (args?.transitGatewayId === undefined && !opts.urn) {
throw new Error("Missing required property 'transitGatewayId'");
}
if (args?.vpcId === undefined && !opts.urn) {
throw new Error("Missing required property 'vpcId'");
}
resourceInputs["applianceModeSupport"] = args?.applianceModeSupport;
resourceInputs["dnsSupport"] = args?.dnsSupport;
resourceInputs["ipv6Support"] = args?.ipv6Support;
resourceInputs["region"] = args?.region;
resourceInputs["securityGroupReferencingSupport"] = args?.securityGroupReferencingSupport;
resourceInputs["subnetIds"] = args?.subnetIds;
resourceInputs["tags"] = args?.tags;
resourceInputs["transitGatewayDefaultRouteTableAssociation"] = args?.transitGatewayDefaultRouteTableAssociation;
resourceInputs["transitGatewayDefaultRouteTablePropagation"] = args?.transitGatewayDefaultRouteTablePropagation;
resourceInputs["transitGatewayId"] = args?.transitGatewayId;
resourceInputs["vpcId"] = args?.vpcId;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
resourceInputs["vpcOwnerId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(VpcAttachment.__pulumiType, name, resourceInputs, opts);
}
}
exports.VpcAttachment = VpcAttachment;
/** @internal */
VpcAttachment.__pulumiType = 'aws:ec2transitgateway/vpcAttachment:VpcAttachment';
//# sourceMappingURL=vpcAttachment.js.map
;