@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
111 lines • 4.8 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.Route = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides additional routes for AWS Client VPN endpoints. For more information on usage, please see the
* [AWS Client VPN Administrator's Guide](https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/what-is.html).
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const exampleEndpoint = new aws.ec2clientvpn.Endpoint("example", {
* description: "Example Client VPN endpoint",
* serverCertificateArn: exampleAwsAcmCertificate.arn,
* clientCidrBlock: "10.0.0.0/16",
* authenticationOptions: [{
* type: "certificate-authentication",
* rootCertificateChainArn: exampleAwsAcmCertificate.arn,
* }],
* connectionLogOptions: {
* enabled: false,
* },
* });
* const exampleNetworkAssociation = new aws.ec2clientvpn.NetworkAssociation("example", {
* clientVpnEndpointId: exampleEndpoint.id,
* subnetId: exampleAwsSubnet.id,
* });
* const example = new aws.ec2clientvpn.Route("example", {
* clientVpnEndpointId: exampleEndpoint.id,
* destinationCidrBlock: "0.0.0.0/0",
* targetVpcSubnetId: exampleNetworkAssociation.subnetId,
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import AWS Client VPN routes using the endpoint ID, target subnet ID, and destination CIDR block. All values are separated by a `,`. For example:
*
* ```sh
* $ pulumi import aws:ec2clientvpn/route:Route example cvpn-endpoint-1234567890abcdef,subnet-9876543210fedcba,10.1.0.0/24
* ```
*/
class Route extends pulumi.CustomResource {
/**
* Get an existing Route 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 Route(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Route. 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'] === Route.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["clientVpnEndpointId"] = state?.clientVpnEndpointId;
resourceInputs["description"] = state?.description;
resourceInputs["destinationCidrBlock"] = state?.destinationCidrBlock;
resourceInputs["origin"] = state?.origin;
resourceInputs["region"] = state?.region;
resourceInputs["targetVpcSubnetId"] = state?.targetVpcSubnetId;
resourceInputs["type"] = state?.type;
}
else {
const args = argsOrState;
if (args?.clientVpnEndpointId === undefined && !opts.urn) {
throw new Error("Missing required property 'clientVpnEndpointId'");
}
if (args?.destinationCidrBlock === undefined && !opts.urn) {
throw new Error("Missing required property 'destinationCidrBlock'");
}
if (args?.targetVpcSubnetId === undefined && !opts.urn) {
throw new Error("Missing required property 'targetVpcSubnetId'");
}
resourceInputs["clientVpnEndpointId"] = args?.clientVpnEndpointId;
resourceInputs["description"] = args?.description;
resourceInputs["destinationCidrBlock"] = args?.destinationCidrBlock;
resourceInputs["region"] = args?.region;
resourceInputs["targetVpcSubnetId"] = args?.targetVpcSubnetId;
resourceInputs["origin"] = undefined /*out*/;
resourceInputs["type"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Route.__pulumiType, name, resourceInputs, opts);
}
}
exports.Route = Route;
/** @internal */
Route.__pulumiType = 'aws:ec2clientvpn/route:Route';
//# sourceMappingURL=route.js.map