UNPKG

@pulumi/aws

Version:

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

87 lines 3.6 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.VpnConnectionRoute = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a static route between a VPN connection and a customer gateway. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const vpc = new aws.ec2.Vpc("vpc", {cidrBlock: "10.0.0.0/16"}); * const vpnGateway = new aws.ec2.VpnGateway("vpn_gateway", {vpcId: vpc.id}); * const customerGateway = new aws.ec2.CustomerGateway("customer_gateway", { * bgpAsn: "65000", * ipAddress: "172.0.0.1", * type: "ipsec.1", * }); * const main = new aws.ec2.VpnConnection("main", { * vpnGatewayId: vpnGateway.id, * customerGatewayId: customerGateway.id, * type: "ipsec.1", * staticRoutesOnly: true, * }); * const office = new aws.ec2.VpnConnectionRoute("office", { * destinationCidrBlock: "192.168.10.0/24", * vpnConnectionId: main.id, * }); * ``` */ class VpnConnectionRoute extends pulumi.CustomResource { /** * Get an existing VpnConnectionRoute 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 VpnConnectionRoute(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of VpnConnectionRoute. 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'] === VpnConnectionRoute.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["destinationCidrBlock"] = state?.destinationCidrBlock; resourceInputs["region"] = state?.region; resourceInputs["vpnConnectionId"] = state?.vpnConnectionId; } else { const args = argsOrState; if (args?.destinationCidrBlock === undefined && !opts.urn) { throw new Error("Missing required property 'destinationCidrBlock'"); } if (args?.vpnConnectionId === undefined && !opts.urn) { throw new Error("Missing required property 'vpnConnectionId'"); } resourceInputs["destinationCidrBlock"] = args?.destinationCidrBlock; resourceInputs["region"] = args?.region; resourceInputs["vpnConnectionId"] = args?.vpnConnectionId; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(VpnConnectionRoute.__pulumiType, name, resourceInputs, opts); } } exports.VpnConnectionRoute = VpnConnectionRoute; /** @internal */ VpnConnectionRoute.__pulumiType = 'aws:ec2/vpnConnectionRoute:VpnConnectionRoute'; //# sourceMappingURL=vpnConnectionRoute.js.map