GatewayVpnAttachment

class GatewayVpnAttachment : KotlinCustomResource

Provides a VPN Gateway Vpn Attachment resource. For information about VPN Gateway Vpn Attachment and how to use it, see What is Vpn Attachment.

NOTE: Available since v1.181.0.

Example Usage

Basic Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.vpn.CustomerGateway;
import com.pulumi.alicloud.vpn.CustomerGatewayArgs;
import com.pulumi.alicloud.vpn.GatewayVpnAttachment;
import com.pulumi.alicloud.vpn.GatewayVpnAttachmentArgs;
import com.pulumi.alicloud.vpn.inputs.GatewayVpnAttachmentIkeConfigArgs;
import com.pulumi.alicloud.vpn.inputs.GatewayVpnAttachmentIpsecConfigArgs;
import com.pulumi.alicloud.vpn.inputs.GatewayVpnAttachmentBgpConfigArgs;
import com.pulumi.alicloud.vpn.inputs.GatewayVpnAttachmentHealthCheckConfigArgs;
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) {
final var config = ctx.config();
final var name = config.get("name").orElse("tf-example");
var defaultCustomerGateway = new CustomerGateway("defaultCustomerGateway", CustomerGatewayArgs.builder()
.ipAddress("42.104.22.210")
.asn("45014")
.description(name)
.build());
var defaultGatewayVpnAttachment = new GatewayVpnAttachment("defaultGatewayVpnAttachment", GatewayVpnAttachmentArgs.builder()
.customerGatewayId(defaultCustomerGateway.id())
.networkType("public")
.localSubnet("0.0.0.0/0")
.remoteSubnet("0.0.0.0/0")
.effectImmediately(false)
.ikeConfig(GatewayVpnAttachmentIkeConfigArgs.builder()
.ikeAuthAlg("md5")
.ikeEncAlg("des")
.ikeVersion("ikev2")
.ikeMode("main")
.ikeLifetime(86400)
.psk("tf-testvpn2")
.ikePfs("group1")
.remoteId("testbob2")
.localId("testalice2")
.build())
.ipsecConfig(GatewayVpnAttachmentIpsecConfigArgs.builder()
.ipsecPfs("group5")
.ipsecEncAlg("des")
.ipsecAuthAlg("md5")
.ipsecLifetime(86400)
.build())
.bgpConfig(GatewayVpnAttachmentBgpConfigArgs.builder()
.enable(true)
.localAsn(45014)
.tunnelCidr("169.254.11.0/30")
.localBgpIp("169.254.11.1")
.build())
.healthCheckConfig(GatewayVpnAttachmentHealthCheckConfigArgs.builder()
.enable(true)
.sip("192.168.1.1")
.dip("10.0.0.1")
.interval(10)
.retry(10)
.policy("revoke_route")
.build())
.enableDpd(true)
.enableNatTraversal(true)
.vpnAttachmentName(name)
.build());
}
}

Import

VPN Gateway Vpn Attachment can be imported using the id, e.g.

$ pulumi import alicloud:vpn/gatewayVpnAttachment:GatewayVpnAttachment example <id>

Properties

Link copied to clipboard

Bgp configuration information. See bgp_config below.

Link copied to clipboard

The ID of the customer gateway. From version 1.196.0, customer_gateway_id can be modified.

Link copied to clipboard

Indicates whether IPsec-VPN negotiations are initiated immediately. Valid values.

Link copied to clipboard
val enableDpd: Output<Boolean>

Whether to enable the DPD (peer survival detection) function.

Link copied to clipboard

Allow NAT penetration.

Link copied to clipboard

Health check configuration information. See health_check_config below.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

Configuration negotiated in the second stage. See ike_config below.

Link copied to clipboard
val internetIp: Output<String>

The VPN gateway IP.

Link copied to clipboard

Configuration negotiated in the second stage. See ipsec_config below.

Link copied to clipboard
val localSubnet: Output<String>

The CIDR block of the virtual private cloud (VPC).

Link copied to clipboard
val networkType: Output<String>

The network type of the IPsec connection. Valid values: public, private.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val remoteSubnet: Output<String>

The CIDR block of the on-premises data center.

Link copied to clipboard
val status: Output<String>

The status of the resource.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard

The name of the vpn attachment.