1. Packages
  2. Ionoscloud Provider
  3. API Docs
  4. getVpnIpsecTunnel
ionoscloud 6.7.6 published on Monday, Apr 14, 2025 by ionos-cloud

ionoscloud.getVpnIpsecTunnel

Explore with Pulumi AI

ionoscloud logo
ionoscloud 6.7.6 published on Monday, Apr 14, 2025 by ionos-cloud

    The VPN IPSec Gateway Tunnel data source can be used to search for and return an existing IPSec Gateway Tunnel. You can provide a string for the name parameter which will be compared with provisioned IPSec Gateway Tunnels. If a single match is found, it will be returned. If your search results in multiple matches, an error will be returned. When this happens, please refine your search string so that it is specific enough to return only one result.

    Example Usage

    By ID

    import * as pulumi from "@pulumi/pulumi";
    import * as ionoscloud from "@pulumi/ionoscloud";
    
    const example = ionoscloud.getVpnIpsecTunnel({
        gatewayId: "gateway_id",
        id: "tunnel_id",
        location: "gateway_location",
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    example = ionoscloud.get_vpn_ipsec_tunnel(gateway_id="gateway_id",
        id="tunnel_id",
        location="gateway_location")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ionoscloud/v6/ionoscloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ionoscloud.LookupVpnIpsecTunnel(ctx, &ionoscloud.LookupVpnIpsecTunnelArgs{
    			GatewayId: "gateway_id",
    			Id:        pulumi.StringRef("tunnel_id"),
    			Location:  pulumi.StringRef("gateway_location"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ionoscloud = Pulumi.Ionoscloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Ionoscloud.GetVpnIpsecTunnel.Invoke(new()
        {
            GatewayId = "gateway_id",
            Id = "tunnel_id",
            Location = "gateway_location",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ionoscloud.IonoscloudFunctions;
    import com.pulumi.ionoscloud.inputs.GetVpnIpsecTunnelArgs;
    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 example = IonoscloudFunctions.getVpnIpsecTunnel(GetVpnIpsecTunnelArgs.builder()
                .gatewayId("gateway_id")
                .id("tunnel_id")
                .location("gateway_location")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ionoscloud:getVpnIpsecTunnel
          arguments:
            gatewayId: gateway_id
            id: tunnel_id
            location: gateway_location
    

    By Name

    Needs to have the resource be previously created, or a depends_on clause to ensure that the resource is created before this data source is called.

    import * as pulumi from "@pulumi/pulumi";
    import * as ionoscloud from "@pulumi/ionoscloud";
    
    const example = ionoscloud.getVpnIpsecTunnel({
        gatewayId: "gateway_id",
        location: "gateway_location",
        name: "ipsec-tunnel",
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    example = ionoscloud.get_vpn_ipsec_tunnel(gateway_id="gateway_id",
        location="gateway_location",
        name="ipsec-tunnel")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ionoscloud/v6/ionoscloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ionoscloud.LookupVpnIpsecTunnel(ctx, &ionoscloud.LookupVpnIpsecTunnelArgs{
    			GatewayId: "gateway_id",
    			Location:  pulumi.StringRef("gateway_location"),
    			Name:      pulumi.StringRef("ipsec-tunnel"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ionoscloud = Pulumi.Ionoscloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Ionoscloud.GetVpnIpsecTunnel.Invoke(new()
        {
            GatewayId = "gateway_id",
            Location = "gateway_location",
            Name = "ipsec-tunnel",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ionoscloud.IonoscloudFunctions;
    import com.pulumi.ionoscloud.inputs.GetVpnIpsecTunnelArgs;
    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 example = IonoscloudFunctions.getVpnIpsecTunnel(GetVpnIpsecTunnelArgs.builder()
                .gatewayId("gateway_id")
                .location("gateway_location")
                .name("ipsec-tunnel")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ionoscloud:getVpnIpsecTunnel
          arguments:
            gatewayId: gateway_id
            location: gateway_location
            name: ipsec-tunnel
    

    Attributes reference

    The following attributes are returned by the datasource:

    • id - The unique ID of the IPSec Gateway Tunnel.
    • name - The name of the IPSec Gateway Tunnel.
    • description - The human-readable description of your IPSec Gateway Tunnel.
    • remote_host - The remote peer host fully qualified domain name or public IPV4 IP to connect to.
    • ike - Settings for the initial security exchange phase.
      • diffie_hellman_group - The Diffie-Hellman Group to use for IPSec Encryption.
      • encryption_algorithm - The encryption algorithm to use for IPSec Encryption.
      • integrity_algorithm - The integrity algorithm to use for IPSec Encryption.
      • lifetime - The phase lifetime in seconds.
    • esp - Settings for the IPSec SA (ESP) phase.
      • diffie_hellman_group - The Diffie-Hellman Group to use for IPSec Encryption.
      • encryption_algorithm - The encryption algorithm to use for IPSec Encryption.
      • integrity_algorithm - The integrity algorithm to use for IPSec Encryption.
      • lifetime - The phase lifetime in seconds.
    • auth - Properties with all data needed to define IPSec Authentication.
      • method - The authentication method to use for IPSec Authentication.
    • cloud_network_cidrs - The network CIDRs on the “Left” side that are allowed to connect to the IPSec tunnel, i.e. the CIDRs within your IONOS Cloud LAN. Specify “0.0.0.0/0” or “::/0” for all addresses.
    • peer_network_cidrs - The network CIDRs on the “Right” side that are allowed to connect to the IPSec tunnel. Specify “0.0.0.0/0” or “::/0” for all addresses.

    Using getVpnIpsecTunnel

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getVpnIpsecTunnel(args: GetVpnIpsecTunnelArgs, opts?: InvokeOptions): Promise<GetVpnIpsecTunnelResult>
    function getVpnIpsecTunnelOutput(args: GetVpnIpsecTunnelOutputArgs, opts?: InvokeOptions): Output<GetVpnIpsecTunnelResult>
    def get_vpn_ipsec_tunnel(gateway_id: Optional[str] = None,
                             id: Optional[str] = None,
                             location: Optional[str] = None,
                             name: Optional[str] = None,
                             opts: Optional[InvokeOptions] = None) -> GetVpnIpsecTunnelResult
    def get_vpn_ipsec_tunnel_output(gateway_id: Optional[pulumi.Input[str]] = None,
                             id: Optional[pulumi.Input[str]] = None,
                             location: Optional[pulumi.Input[str]] = None,
                             name: Optional[pulumi.Input[str]] = None,
                             opts: Optional[InvokeOptions] = None) -> Output[GetVpnIpsecTunnelResult]
    func LookupVpnIpsecTunnel(ctx *Context, args *LookupVpnIpsecTunnelArgs, opts ...InvokeOption) (*LookupVpnIpsecTunnelResult, error)
    func LookupVpnIpsecTunnelOutput(ctx *Context, args *LookupVpnIpsecTunnelOutputArgs, opts ...InvokeOption) LookupVpnIpsecTunnelResultOutput

    > Note: This function is named LookupVpnIpsecTunnel in the Go SDK.

    public static class GetVpnIpsecTunnel 
    {
        public static Task<GetVpnIpsecTunnelResult> InvokeAsync(GetVpnIpsecTunnelArgs args, InvokeOptions? opts = null)
        public static Output<GetVpnIpsecTunnelResult> Invoke(GetVpnIpsecTunnelInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetVpnIpsecTunnelResult> getVpnIpsecTunnel(GetVpnIpsecTunnelArgs args, InvokeOptions options)
    public static Output<GetVpnIpsecTunnelResult> getVpnIpsecTunnel(GetVpnIpsecTunnelArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ionoscloud:index/getVpnIpsecTunnel:getVpnIpsecTunnel
      arguments:
        # arguments dictionary

    The following arguments are supported:

    GatewayId string
    The ID of the IPSec Gateway that the tunnel belongs to.
    Id string
    ID of an existing IPSec Gateway Tunnel that you want to search for.
    Location string
    The location of the IPSec Gateway Tunnel.
    Name string
    Name of an existing IPSec Gateway Tunnel that you want to search for.
    GatewayId string
    The ID of the IPSec Gateway that the tunnel belongs to.
    Id string
    ID of an existing IPSec Gateway Tunnel that you want to search for.
    Location string
    The location of the IPSec Gateway Tunnel.
    Name string
    Name of an existing IPSec Gateway Tunnel that you want to search for.
    gatewayId String
    The ID of the IPSec Gateway that the tunnel belongs to.
    id String
    ID of an existing IPSec Gateway Tunnel that you want to search for.
    location String
    The location of the IPSec Gateway Tunnel.
    name String
    Name of an existing IPSec Gateway Tunnel that you want to search for.
    gatewayId string
    The ID of the IPSec Gateway that the tunnel belongs to.
    id string
    ID of an existing IPSec Gateway Tunnel that you want to search for.
    location string
    The location of the IPSec Gateway Tunnel.
    name string
    Name of an existing IPSec Gateway Tunnel that you want to search for.
    gateway_id str
    The ID of the IPSec Gateway that the tunnel belongs to.
    id str
    ID of an existing IPSec Gateway Tunnel that you want to search for.
    location str
    The location of the IPSec Gateway Tunnel.
    name str
    Name of an existing IPSec Gateway Tunnel that you want to search for.
    gatewayId String
    The ID of the IPSec Gateway that the tunnel belongs to.
    id String
    ID of an existing IPSec Gateway Tunnel that you want to search for.
    location String
    The location of the IPSec Gateway Tunnel.
    name String
    Name of an existing IPSec Gateway Tunnel that you want to search for.

    getVpnIpsecTunnel Result

    The following output properties are available:

    Supporting Types

    GetVpnIpsecTunnelAuth

    Method string
    Method string
    method String
    method string
    method str
    method String

    GetVpnIpsecTunnelEsp

    GetVpnIpsecTunnelIke

    Package Details

    Repository
    ionoscloud ionos-cloud/terraform-provider-ionoscloud
    License
    Notes
    This Pulumi package is based on the ionoscloud Terraform Provider.
    ionoscloud logo
    ionoscloud 6.7.6 published on Monday, Apr 14, 2025 by ionos-cloud