VpnGatewayAttachmentArgs

data class VpnGatewayAttachmentArgs(val vpcId: Output<String>? = null, val vpnGatewayId: Output<String>? = null) : ConvertibleToJava<VpnGatewayAttachmentArgs>

Provides a Virtual Private Gateway attachment resource, allowing for an existing hardware VPN gateway to be attached and/or detached from a VPC.

Note: The aws.ec2.VpnGateway resource can also automatically attach the Virtual Private Gateway it creates to an existing VPC by setting the vpc_id attribute accordingly.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.Vpc;
import com.pulumi.aws.ec2.VpcArgs;
import com.pulumi.aws.ec2.VpnGateway;
import com.pulumi.aws.ec2.VpnGatewayArgs;
import com.pulumi.aws.ec2.VpnGatewayAttachment;
import com.pulumi.aws.ec2.VpnGatewayAttachmentArgs;
import java.util.List;
import java.util.ArrayList;
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 network = new Vpc("network", VpcArgs.builder()
.cidrBlock("10.0.0.0/16")
.build());
var vpn = new VpnGateway("vpn", VpnGatewayArgs.builder()
.tags(Map.of("Name", "example-vpn-gateway"))
.build());
var vpnAttachment = new VpnGatewayAttachment("vpnAttachment", VpnGatewayAttachmentArgs.builder()
.vpcId(network.id())
.vpnGatewayId(vpn.id())
.build());
}
}

Import

This resource does not support importing.

Constructors

Link copied to clipboard
constructor(vpcId: Output<String>? = null, vpnGatewayId: Output<String>? = null)

Properties

Link copied to clipboard
val vpcId: Output<String>? = null

The ID of the VPC.

Link copied to clipboard
val vpnGatewayId: Output<String>? = null

The ID of the Virtual Private Gateway.

Functions

Link copied to clipboard
open override fun toJava(): VpnGatewayAttachmentArgs