@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
97 lines • 4.27 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.Connect = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages an EC2 Transit Gateway Connect.
*
* ## 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,
* });
* const attachment = new aws.ec2transitgateway.Connect("attachment", {
* transportAttachmentId: example.id,
* transitGatewayId: exampleAwsEc2TransitGateway.id,
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import `aws_ec2_transit_gateway_connect` using the EC2 Transit Gateway Connect identifier. For example:
*
* ```sh
* $ pulumi import aws:ec2transitgateway/connect:Connect example tgw-attach-12345678
* ```
*/
class Connect extends pulumi.CustomResource {
/**
* Get an existing Connect 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 Connect(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Connect. 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'] === Connect.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["protocol"] = state?.protocol;
resourceInputs["region"] = state?.region;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["transitGatewayDefaultRouteTableAssociation"] = state?.transitGatewayDefaultRouteTableAssociation;
resourceInputs["transitGatewayDefaultRouteTablePropagation"] = state?.transitGatewayDefaultRouteTablePropagation;
resourceInputs["transitGatewayId"] = state?.transitGatewayId;
resourceInputs["transportAttachmentId"] = state?.transportAttachmentId;
}
else {
const args = argsOrState;
if (args?.transitGatewayId === undefined && !opts.urn) {
throw new Error("Missing required property 'transitGatewayId'");
}
if (args?.transportAttachmentId === undefined && !opts.urn) {
throw new Error("Missing required property 'transportAttachmentId'");
}
resourceInputs["protocol"] = args?.protocol;
resourceInputs["region"] = args?.region;
resourceInputs["tags"] = args?.tags;
resourceInputs["transitGatewayDefaultRouteTableAssociation"] = args?.transitGatewayDefaultRouteTableAssociation;
resourceInputs["transitGatewayDefaultRouteTablePropagation"] = args?.transitGatewayDefaultRouteTablePropagation;
resourceInputs["transitGatewayId"] = args?.transitGatewayId;
resourceInputs["transportAttachmentId"] = args?.transportAttachmentId;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Connect.__pulumiType, name, resourceInputs, opts);
}
}
exports.Connect = Connect;
/** @internal */
Connect.__pulumiType = 'aws:ec2transitgateway/connect:Connect';
//# sourceMappingURL=connect.js.map
;