Route class

Provides additional routes for AWS Client VPN endpoints. For more information on usage, please see the AWS Client VPN Administrator's Guide.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const exampleEndpoint = new aws.ec2clientvpn.Endpoint("example", {
    connectionLogOptions: {
        enabled: false,
    },
    authenticationOptions: [{
        type: "certificate-authentication",
        rootCertificateChainArn: exampleAwsAcmCertificate.arn,
    }],
    description: "Example Client VPN endpoint",
    serverCertificateArn: exampleAwsAcmCertificate.arn,
    clientCidrBlock: "10.0.0.0/16",
});
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 pulumi
import pulumi_aws as aws

example_endpoint = aws.ec2clientvpn.Endpoint("example",
    connection_log_options={
        "enabled": False,
    },
    authentication_options=[{
        "type": "certificate-authentication",
        "root_certificate_chain_arn": example_aws_acm_certificate["arn"],
    }],
    description="Example Client VPN endpoint",
    server_certificate_arn=example_aws_acm_certificate["arn"],
    client_cidr_block="10.0.0.0/16")
example_network_association = aws.ec2clientvpn.NetworkAssociation("example",
    client_vpn_endpoint_id=example_endpoint.id,
    subnet_id=example_aws_subnet["id"])
example = aws.ec2clientvpn.Route("example",
    client_vpn_endpoint_id=example_endpoint.id,
    destination_cidr_block="0.0.0.0/0",
    target_vpc_subnet_id=example_network_association.subnet_id)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var exampleEndpoint = new Aws.Ec2ClientVpn.Endpoint("example", new()
    {
        ConnectionLogOptions = new Aws.Ec2ClientVpn.Inputs.EndpointConnectionLogOptionsArgs
        {
            Enabled = false,
        },
        AuthenticationOptions = new[]
        {
            new Aws.Ec2ClientVpn.Inputs.EndpointAuthenticationOptionArgs
            {
                Type = "certificate-authentication",
                RootCertificateChainArn = exampleAwsAcmCertificate.Arn,
            },
        },
        Description = "Example Client VPN endpoint",
        ServerCertificateArn = exampleAwsAcmCertificate.Arn,
        ClientCidrBlock = "10.0.0.0/16",
    });

    var exampleNetworkAssociation = new Aws.Ec2ClientVpn.NetworkAssociation("example", new()
    {
        ClientVpnEndpointId = exampleEndpoint.Id,
        SubnetId = exampleAwsSubnet.Id,
    });

    var example = new Aws.Ec2ClientVpn.Route("example", new()
    {
        ClientVpnEndpointId = exampleEndpoint.Id,
        DestinationCidrBlock = "0.0.0.0/0",
        TargetVpcSubnetId = exampleNetworkAssociation.SubnetId,
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/ec2clientvpn"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleEndpoint, err := ec2clientvpn.NewEndpoint(ctx, "example", &ec2clientvpn.EndpointArgs{
			ConnectionLogOptions: &ec2clientvpn.EndpointConnectionLogOptionsArgs{
				Enabled: pulumi.Bool(false),
			},
			AuthenticationOptions: ec2clientvpn.EndpointAuthenticationOptionArray{
				&ec2clientvpn.EndpointAuthenticationOptionArgs{
					Type:                    pulumi.String("certificate-authentication"),
					RootCertificateChainArn: pulumi.Any(exampleAwsAcmCertificate.Arn),
				},
			},
			Description:          pulumi.String("Example Client VPN endpoint"),
			ServerCertificateArn: pulumi.Any(exampleAwsAcmCertificate.Arn),
			ClientCidrBlock:      pulumi.String("10.0.0.0/16"),
		})
		if err != nil {
			return err
		}
		exampleNetworkAssociation, err := ec2clientvpn.NewNetworkAssociation(ctx, "example", &ec2clientvpn.NetworkAssociationArgs{
			ClientVpnEndpointId: exampleEndpoint.ID().ToIDOutput().ToStringOutput(),
			SubnetId:            pulumi.Any(exampleAwsSubnet.Id),
		})
		if err != nil {
			return err
		}
		_, err = ec2clientvpn.NewRoute(ctx, "example", &ec2clientvpn.RouteArgs{
			ClientVpnEndpointId:  exampleEndpoint.ID().ToIDOutput().ToStringOutput(),
			DestinationCidrBlock: pulumi.String("0.0.0.0/0"),
			TargetVpcSubnetId:    exampleNetworkAssociation.SubnetId,
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_ec2clientvpn_route" "example" {
  client_vpn_endpoint_id = aws_ec2clientvpn_endpoint.example.id
  destination_cidr_block = "0.0.0.0/0"
  target_vpc_subnet_id   = aws_ec2clientvpn_networkassociation.example.subnet_id
}
resource "aws_ec2clientvpn_networkassociation" "example" {
  client_vpn_endpoint_id = aws_ec2clientvpn_endpoint.example.id
  subnet_id              = exampleAwsSubnet.id
}
resource "aws_ec2clientvpn_endpoint" "example" {
  connection_log_options = {
    enabled = false
  }
  authentication_options {
    type                       = "certificate-authentication"
    root_certificate_chain_arn = exampleAwsAcmCertificate.arn
  }
  description            = "Example Client VPN endpoint"
  server_certificate_arn = exampleAwsAcmCertificate.arn
  client_cidr_block      = "10.0.0.0/16"
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2clientvpn.Endpoint;
import com.pulumi.aws.ec2clientvpn.EndpointArgs;
import com.pulumi.aws.ec2clientvpn.inputs.EndpointConnectionLogOptionsArgs;
import com.pulumi.aws.ec2clientvpn.inputs.EndpointAuthenticationOptionArgs;
import com.pulumi.aws.ec2clientvpn.NetworkAssociation;
import com.pulumi.aws.ec2clientvpn.NetworkAssociationArgs;
import com.pulumi.aws.ec2clientvpn.Route;
import com.pulumi.aws.ec2clientvpn.RouteArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var exampleEndpoint = new Endpoint("exampleEndpoint", EndpointArgs.builder()
            .connectionLogOptions(EndpointConnectionLogOptionsArgs.builder()
                .enabled(false)
                .build())
            .authenticationOptions(EndpointAuthenticationOptionArgs.builder()
                .type("certificate-authentication")
                .rootCertificateChainArn(exampleAwsAcmCertificate.arn())
                .build())
            .description("Example Client VPN endpoint")
            .serverCertificateArn(exampleAwsAcmCertificate.arn())
            .clientCidrBlock("10.0.0.0/16")
            .build());

        var exampleNetworkAssociation = new NetworkAssociation("exampleNetworkAssociation", NetworkAssociationArgs.builder()
            .clientVpnEndpointId(exampleEndpoint.id())
            .subnetId(exampleAwsSubnet.id())
            .build());

        var example = new Route("example", RouteArgs.builder()
            .clientVpnEndpointId(exampleEndpoint.id())
            .destinationCidrBlock("0.0.0.0/0")
            .targetVpcSubnetId(exampleNetworkAssociation.subnetId())
            .build());

    }
}
resources:
  example:
    type: aws:ec2clientvpn:Route
    properties:
      clientVpnEndpointId: ${exampleEndpoint.id}
      destinationCidrBlock: 0.0.0.0/0
      targetVpcSubnetId: ${exampleNetworkAssociation.subnetId}
  exampleNetworkAssociation:
    type: aws:ec2clientvpn:NetworkAssociation
    name: example
    properties:
      clientVpnEndpointId: ${exampleEndpoint.id}
      subnetId: ${exampleAwsSubnet.id}
  exampleEndpoint:
    type: aws:ec2clientvpn:Endpoint
    name: example
    properties:
      connectionLogOptions:
        enabled: false
      authenticationOptions:
        - type: certificate-authentication
          rootCertificateChainArn: ${exampleAwsAcmCertificate.arn}
      description: Example Client VPN endpoint
      serverCertificateArn: ${exampleAwsAcmCertificate.arn}
      clientCidrBlock: 10.0.0.0/16

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:

$ pulumi import aws:ec2clientvpn/route:Route example cvpn-endpoint-1234567890abcdef,subnet-9876543210fedcba,10.1.0.0/24

Constructors

Route(String name, {RouteArgs? args, CustomResourceOptions? options})
Creates a new Route. name The Pulumi resource name. args Arguments used to configure this Route. The set of arguments for Route. options Resource options controlling this resource's behavior.
Route.reference(String urn)
Creates a typed reference to an existing Route resource.

Properties

childResources → Set<Resource>
finalinherited
clientVpnEndpointId ↔ Output<String>
The ID of the Client VPN endpoint.
latefinal
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
description ↔ Output<String?>
A brief description of the route.
latefinal
destinationCidrBlock ↔ Output<String>
The IPv4 or IPv6 address range, in CIDR notation, of the route destination.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
origin ↔ Output<String>
Indicates how the Client VPN route was added. Will be add-route for routes created by this resource.
latefinal
region ↔ Output<String>
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
targetVpcSubnetId ↔ Output<String?>
The ID of the Subnet to route the traffic through. It must already be attached to the Client VPN. Required for VPC-based Client VPN endpoints. Not applicable for Transit Gateway-based Client VPN endpoints.
latefinal
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
transitGatewayAttachmentId ↔ Output<String>
The ID of the Transit Gateway attachment, if the route targets a Transit Gateway-based Client VPN endpoint.
latefinal
type ↔ Output<String>
The type of the route.
latefinal
urn ↔ Output<String>
latefinalinherited

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {RouteState? state, CustomResourceOptions? options}) → Route
Gets an existing Route resource's state with the given name and id.