UNPKG

@pulumi/aws

Version:

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

116 lines 5.26 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.CustomerGatewayAssociation = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages a Network Manager Customer Gateway Association. * * Use this resource to associate a customer gateway with a device and optionally, with a link. If you specify a link, it must be associated with the specified device. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.networkmanager.GlobalNetwork("example", {description: "example"}); * const exampleSite = new aws.networkmanager.Site("example", {globalNetworkId: example.id}); * const exampleDevice = new aws.networkmanager.Device("example", { * globalNetworkId: example.id, * siteId: exampleSite.id, * }); * const exampleCustomerGateway = new aws.ec2.CustomerGateway("example", { * bgpAsn: "65000", * ipAddress: "172.83.124.10", * type: "ipsec.1", * }); * const exampleTransitGateway = new aws.ec2transitgateway.TransitGateway("example", {}); * const exampleVpnConnection = new aws.ec2.VpnConnection("example", { * customerGatewayId: exampleCustomerGateway.id, * transitGatewayId: exampleTransitGateway.id, * type: exampleCustomerGateway.type, * staticRoutesOnly: true, * }); * const exampleTransitGatewayRegistration = new aws.networkmanager.TransitGatewayRegistration("example", { * globalNetworkId: example.id, * transitGatewayArn: exampleTransitGateway.arn, * }, { * dependsOn: [exampleVpnConnection], * }); * const exampleCustomerGatewayAssociation = new aws.networkmanager.CustomerGatewayAssociation("example", { * globalNetworkId: example.id, * customerGatewayArn: exampleCustomerGateway.arn, * deviceId: exampleDevice.id, * }, { * dependsOn: [exampleTransitGatewayRegistration], * }); * ``` * * ## Import * * Using `pulumi import`, import `aws_networkmanager_customer_gateway_association` using the global network ID and customer gateway ARN. For example: * * ```sh * $ pulumi import aws:networkmanager/customerGatewayAssociation:CustomerGatewayAssociation example global-network-0d47f6t230mz46dy4,arn:aws:ec2:us-west-2:123456789012:customer-gateway/cgw-123abc05e04123abc * ``` */ class CustomerGatewayAssociation extends pulumi.CustomResource { /** * Get an existing CustomerGatewayAssociation 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 CustomerGatewayAssociation(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of CustomerGatewayAssociation. 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'] === CustomerGatewayAssociation.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["customerGatewayArn"] = state?.customerGatewayArn; resourceInputs["deviceId"] = state?.deviceId; resourceInputs["globalNetworkId"] = state?.globalNetworkId; resourceInputs["linkId"] = state?.linkId; } else { const args = argsOrState; if (args?.customerGatewayArn === undefined && !opts.urn) { throw new Error("Missing required property 'customerGatewayArn'"); } if (args?.deviceId === undefined && !opts.urn) { throw new Error("Missing required property 'deviceId'"); } if (args?.globalNetworkId === undefined && !opts.urn) { throw new Error("Missing required property 'globalNetworkId'"); } resourceInputs["customerGatewayArn"] = args?.customerGatewayArn; resourceInputs["deviceId"] = args?.deviceId; resourceInputs["globalNetworkId"] = args?.globalNetworkId; resourceInputs["linkId"] = args?.linkId; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(CustomerGatewayAssociation.__pulumiType, name, resourceInputs, opts); } } exports.CustomerGatewayAssociation = CustomerGatewayAssociation; /** @internal */ CustomerGatewayAssociation.__pulumiType = 'aws:networkmanager/customerGatewayAssociation:CustomerGatewayAssociation'; //# sourceMappingURL=customerGatewayAssociation.js.map