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

ionoscloud.VpnWireguardPeer

Explore with Pulumi AI

This page provides an overview of the ionoscloud.VpnWireguardPeer resource, which allows you to manage a WireGuard Peer in your cloud infrastructure. This resource enables the creation, management, and deletion of a WireGuard VPN Peer, facilitating secure connections between your network resources.

Example Usage

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

const example = new ionoscloud.VpnWireguardPeer("example", {
    allowedIps: [
        "10.0.0.0/8",
        "192.168.1.0/24",
    ],
    description: "An example WireGuard peer",
    endpoint: {
        host: "1.2.3.4",
        port: 51820,
    },
    gatewayId: "your gateway id here",
    location: "de/fra",
    publicKey: "examplePublicKey==",
});
Copy
import pulumi
import pulumi_ionoscloud as ionoscloud

example = ionoscloud.VpnWireguardPeer("example",
    allowed_ips=[
        "10.0.0.0/8",
        "192.168.1.0/24",
    ],
    description="An example WireGuard peer",
    endpoint={
        "host": "1.2.3.4",
        "port": 51820,
    },
    gateway_id="your gateway id here",
    location="de/fra",
    public_key="examplePublicKey==")
Copy
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.NewVpnWireguardPeer(ctx, "example", &ionoscloud.VpnWireguardPeerArgs{
			AllowedIps: pulumi.StringArray{
				pulumi.String("10.0.0.0/8"),
				pulumi.String("192.168.1.0/24"),
			},
			Description: pulumi.String("An example WireGuard peer"),
			Endpoint: &ionoscloud.VpnWireguardPeerEndpointArgs{
				Host: pulumi.String("1.2.3.4"),
				Port: pulumi.Float64(51820),
			},
			GatewayId: pulumi.String("your gateway id here"),
			Location:  pulumi.String("de/fra"),
			PublicKey: pulumi.String("examplePublicKey=="),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ionoscloud = Pulumi.Ionoscloud;

return await Deployment.RunAsync(() => 
{
    var example = new Ionoscloud.VpnWireguardPeer("example", new()
    {
        AllowedIps = new[]
        {
            "10.0.0.0/8",
            "192.168.1.0/24",
        },
        Description = "An example WireGuard peer",
        Endpoint = new Ionoscloud.Inputs.VpnWireguardPeerEndpointArgs
        {
            Host = "1.2.3.4",
            Port = 51820,
        },
        GatewayId = "your gateway id here",
        Location = "de/fra",
        PublicKey = "examplePublicKey==",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.VpnWireguardPeer;
import com.pulumi.ionoscloud.VpnWireguardPeerArgs;
import com.pulumi.ionoscloud.inputs.VpnWireguardPeerEndpointArgs;
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 example = new VpnWireguardPeer("example", VpnWireguardPeerArgs.builder()
            .allowedIps(            
                "10.0.0.0/8",
                "192.168.1.0/24")
            .description("An example WireGuard peer")
            .endpoint(VpnWireguardPeerEndpointArgs.builder()
                .host("1.2.3.4")
                .port(51820)
                .build())
            .gatewayId("your gateway id here")
            .location("de/fra")
            .publicKey("examplePublicKey==")
            .build());

    }
}
Copy
resources:
  example:
    type: ionoscloud:VpnWireguardPeer
    properties:
      allowedIps:
        - 10.0.0.0/8
        - 192.168.1.0/24
      description: An example WireGuard peer
      endpoint:
        host: 1.2.3.4
        port: 51820
      gatewayId: your gateway id here
      location: de/fra
      publicKey: examplePublicKey==
Copy

Create VpnWireguardPeer Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new VpnWireguardPeer(name: string, args: VpnWireguardPeerArgs, opts?: CustomResourceOptions);
@overload
def VpnWireguardPeer(resource_name: str,
                     args: VpnWireguardPeerArgs,
                     opts: Optional[ResourceOptions] = None)

@overload
def VpnWireguardPeer(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     allowed_ips: Optional[Sequence[str]] = None,
                     gateway_id: Optional[str] = None,
                     public_key: Optional[str] = None,
                     description: Optional[str] = None,
                     endpoint: Optional[VpnWireguardPeerEndpointArgs] = None,
                     location: Optional[str] = None,
                     name: Optional[str] = None,
                     timeouts: Optional[VpnWireguardPeerTimeoutsArgs] = None,
                     vpn_wireguard_peer_id: Optional[str] = None)
func NewVpnWireguardPeer(ctx *Context, name string, args VpnWireguardPeerArgs, opts ...ResourceOption) (*VpnWireguardPeer, error)
public VpnWireguardPeer(string name, VpnWireguardPeerArgs args, CustomResourceOptions? opts = null)
public VpnWireguardPeer(String name, VpnWireguardPeerArgs args)
public VpnWireguardPeer(String name, VpnWireguardPeerArgs args, CustomResourceOptions options)
type: ionoscloud:VpnWireguardPeer
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. VpnWireguardPeerArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. VpnWireguardPeerArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. VpnWireguardPeerArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. VpnWireguardPeerArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. VpnWireguardPeerArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var vpnWireguardPeerResource = new Ionoscloud.VpnWireguardPeer("vpnWireguardPeerResource", new()
{
    AllowedIps = new[]
    {
        "string",
    },
    GatewayId = "string",
    PublicKey = "string",
    Description = "string",
    Endpoint = new Ionoscloud.Inputs.VpnWireguardPeerEndpointArgs
    {
        Host = "string",
        Port = 0,
    },
    Location = "string",
    Name = "string",
    Timeouts = new Ionoscloud.Inputs.VpnWireguardPeerTimeoutsArgs
    {
        Create = "string",
        Default = "string",
        Delete = "string",
        Update = "string",
    },
    VpnWireguardPeerId = "string",
});
Copy
example, err := ionoscloud.NewVpnWireguardPeer(ctx, "vpnWireguardPeerResource", &ionoscloud.VpnWireguardPeerArgs{
AllowedIps: pulumi.StringArray{
pulumi.String("string"),
},
GatewayId: pulumi.String("string"),
PublicKey: pulumi.String("string"),
Description: pulumi.String("string"),
Endpoint: &.VpnWireguardPeerEndpointArgs{
Host: pulumi.String("string"),
Port: pulumi.Float64(0),
},
Location: pulumi.String("string"),
Name: pulumi.String("string"),
Timeouts: &.VpnWireguardPeerTimeoutsArgs{
Create: pulumi.String("string"),
Default: pulumi.String("string"),
Delete: pulumi.String("string"),
Update: pulumi.String("string"),
},
VpnWireguardPeerId: pulumi.String("string"),
})
Copy
var vpnWireguardPeerResource = new VpnWireguardPeer("vpnWireguardPeerResource", VpnWireguardPeerArgs.builder()
    .allowedIps("string")
    .gatewayId("string")
    .publicKey("string")
    .description("string")
    .endpoint(VpnWireguardPeerEndpointArgs.builder()
        .host("string")
        .port(0)
        .build())
    .location("string")
    .name("string")
    .timeouts(VpnWireguardPeerTimeoutsArgs.builder()
        .create("string")
        .default_("string")
        .delete("string")
        .update("string")
        .build())
    .vpnWireguardPeerId("string")
    .build());
Copy
vpn_wireguard_peer_resource = ionoscloud.VpnWireguardPeer("vpnWireguardPeerResource",
    allowed_ips=["string"],
    gateway_id="string",
    public_key="string",
    description="string",
    endpoint={
        "host": "string",
        "port": 0,
    },
    location="string",
    name="string",
    timeouts={
        "create": "string",
        "default": "string",
        "delete": "string",
        "update": "string",
    },
    vpn_wireguard_peer_id="string")
Copy
const vpnWireguardPeerResource = new ionoscloud.VpnWireguardPeer("vpnWireguardPeerResource", {
    allowedIps: ["string"],
    gatewayId: "string",
    publicKey: "string",
    description: "string",
    endpoint: {
        host: "string",
        port: 0,
    },
    location: "string",
    name: "string",
    timeouts: {
        create: "string",
        "default": "string",
        "delete": "string",
        update: "string",
    },
    vpnWireguardPeerId: "string",
});
Copy
type: ionoscloud:VpnWireguardPeer
properties:
    allowedIps:
        - string
    description: string
    endpoint:
        host: string
        port: 0
    gatewayId: string
    location: string
    name: string
    publicKey: string
    timeouts:
        create: string
        default: string
        delete: string
        update: string
    vpnWireguardPeerId: string
Copy

VpnWireguardPeer Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The VpnWireguardPeer resource accepts the following input properties:

AllowedIps This property is required. List<string>
[list, string] A list of subnet CIDRs that are allowed to connect to the WireGuard Gateway.
GatewayId This property is required. string
[string] The ID of the WireGuard Gateway that the Peer will connect to.
PublicKey This property is required. string
[string] The public key for the WireGuard Gateway.
Description string
[string] A description of the WireGuard Gateway.
Endpoint VpnWireguardPeerEndpoint
[block] An endpoint configuration block for the WireGuard Gateway. The structure of this block is as follows:
Location string
[string] The location of the WireGuard Gateway.
Name string
[string] The human-readable name of the WireGuard Gateway.
Timeouts VpnWireguardPeerTimeouts
VpnWireguardPeerId string
AllowedIps This property is required. []string
[list, string] A list of subnet CIDRs that are allowed to connect to the WireGuard Gateway.
GatewayId This property is required. string
[string] The ID of the WireGuard Gateway that the Peer will connect to.
PublicKey This property is required. string
[string] The public key for the WireGuard Gateway.
Description string
[string] A description of the WireGuard Gateway.
Endpoint VpnWireguardPeerEndpointArgs
[block] An endpoint configuration block for the WireGuard Gateway. The structure of this block is as follows:
Location string
[string] The location of the WireGuard Gateway.
Name string
[string] The human-readable name of the WireGuard Gateway.
Timeouts VpnWireguardPeerTimeoutsArgs
VpnWireguardPeerId string
allowedIps This property is required. List<String>
[list, string] A list of subnet CIDRs that are allowed to connect to the WireGuard Gateway.
gatewayId This property is required. String
[string] The ID of the WireGuard Gateway that the Peer will connect to.
publicKey This property is required. String
[string] The public key for the WireGuard Gateway.
description String
[string] A description of the WireGuard Gateway.
endpoint VpnWireguardPeerEndpoint
[block] An endpoint configuration block for the WireGuard Gateway. The structure of this block is as follows:
location String
[string] The location of the WireGuard Gateway.
name String
[string] The human-readable name of the WireGuard Gateway.
timeouts VpnWireguardPeerTimeouts
vpnWireguardPeerId String
allowedIps This property is required. string[]
[list, string] A list of subnet CIDRs that are allowed to connect to the WireGuard Gateway.
gatewayId This property is required. string
[string] The ID of the WireGuard Gateway that the Peer will connect to.
publicKey This property is required. string
[string] The public key for the WireGuard Gateway.
description string
[string] A description of the WireGuard Gateway.
endpoint VpnWireguardPeerEndpoint
[block] An endpoint configuration block for the WireGuard Gateway. The structure of this block is as follows:
location string
[string] The location of the WireGuard Gateway.
name string
[string] The human-readable name of the WireGuard Gateway.
timeouts VpnWireguardPeerTimeouts
vpnWireguardPeerId string
allowed_ips This property is required. Sequence[str]
[list, string] A list of subnet CIDRs that are allowed to connect to the WireGuard Gateway.
gateway_id This property is required. str
[string] The ID of the WireGuard Gateway that the Peer will connect to.
public_key This property is required. str
[string] The public key for the WireGuard Gateway.
description str
[string] A description of the WireGuard Gateway.
endpoint VpnWireguardPeerEndpointArgs
[block] An endpoint configuration block for the WireGuard Gateway. The structure of this block is as follows:
location str
[string] The location of the WireGuard Gateway.
name str
[string] The human-readable name of the WireGuard Gateway.
timeouts VpnWireguardPeerTimeoutsArgs
vpn_wireguard_peer_id str
allowedIps This property is required. List<String>
[list, string] A list of subnet CIDRs that are allowed to connect to the WireGuard Gateway.
gatewayId This property is required. String
[string] The ID of the WireGuard Gateway that the Peer will connect to.
publicKey This property is required. String
[string] The public key for the WireGuard Gateway.
description String
[string] A description of the WireGuard Gateway.
endpoint Property Map
[block] An endpoint configuration block for the WireGuard Gateway. The structure of this block is as follows:
location String
[string] The location of the WireGuard Gateway.
name String
[string] The human-readable name of the WireGuard Gateway.
timeouts Property Map
vpnWireguardPeerId String

Outputs

All input properties are implicitly available as output properties. Additionally, the VpnWireguardPeer resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Status string
The current status of the WireGuard Gateway Peer.
Id string
The provider-assigned unique ID for this managed resource.
Status string
The current status of the WireGuard Gateway Peer.
id String
The provider-assigned unique ID for this managed resource.
status String
The current status of the WireGuard Gateway Peer.
id string
The provider-assigned unique ID for this managed resource.
status string
The current status of the WireGuard Gateway Peer.
id str
The provider-assigned unique ID for this managed resource.
status str
The current status of the WireGuard Gateway Peer.
id String
The provider-assigned unique ID for this managed resource.
status String
The current status of the WireGuard Gateway Peer.

Look up Existing VpnWireguardPeer Resource

Get an existing VpnWireguardPeer resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: VpnWireguardPeerState, opts?: CustomResourceOptions): VpnWireguardPeer
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        allowed_ips: Optional[Sequence[str]] = None,
        description: Optional[str] = None,
        endpoint: Optional[VpnWireguardPeerEndpointArgs] = None,
        gateway_id: Optional[str] = None,
        location: Optional[str] = None,
        name: Optional[str] = None,
        public_key: Optional[str] = None,
        status: Optional[str] = None,
        timeouts: Optional[VpnWireguardPeerTimeoutsArgs] = None,
        vpn_wireguard_peer_id: Optional[str] = None) -> VpnWireguardPeer
func GetVpnWireguardPeer(ctx *Context, name string, id IDInput, state *VpnWireguardPeerState, opts ...ResourceOption) (*VpnWireguardPeer, error)
public static VpnWireguardPeer Get(string name, Input<string> id, VpnWireguardPeerState? state, CustomResourceOptions? opts = null)
public static VpnWireguardPeer get(String name, Output<String> id, VpnWireguardPeerState state, CustomResourceOptions options)
resources:  _:    type: ionoscloud:VpnWireguardPeer    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
AllowedIps List<string>
[list, string] A list of subnet CIDRs that are allowed to connect to the WireGuard Gateway.
Description string
[string] A description of the WireGuard Gateway.
Endpoint VpnWireguardPeerEndpoint
[block] An endpoint configuration block for the WireGuard Gateway. The structure of this block is as follows:
GatewayId string
[string] The ID of the WireGuard Gateway that the Peer will connect to.
Location string
[string] The location of the WireGuard Gateway.
Name string
[string] The human-readable name of the WireGuard Gateway.
PublicKey string
[string] The public key for the WireGuard Gateway.
Status string
The current status of the WireGuard Gateway Peer.
Timeouts VpnWireguardPeerTimeouts
VpnWireguardPeerId string
AllowedIps []string
[list, string] A list of subnet CIDRs that are allowed to connect to the WireGuard Gateway.
Description string
[string] A description of the WireGuard Gateway.
Endpoint VpnWireguardPeerEndpointArgs
[block] An endpoint configuration block for the WireGuard Gateway. The structure of this block is as follows:
GatewayId string
[string] The ID of the WireGuard Gateway that the Peer will connect to.
Location string
[string] The location of the WireGuard Gateway.
Name string
[string] The human-readable name of the WireGuard Gateway.
PublicKey string
[string] The public key for the WireGuard Gateway.
Status string
The current status of the WireGuard Gateway Peer.
Timeouts VpnWireguardPeerTimeoutsArgs
VpnWireguardPeerId string
allowedIps List<String>
[list, string] A list of subnet CIDRs that are allowed to connect to the WireGuard Gateway.
description String
[string] A description of the WireGuard Gateway.
endpoint VpnWireguardPeerEndpoint
[block] An endpoint configuration block for the WireGuard Gateway. The structure of this block is as follows:
gatewayId String
[string] The ID of the WireGuard Gateway that the Peer will connect to.
location String
[string] The location of the WireGuard Gateway.
name String
[string] The human-readable name of the WireGuard Gateway.
publicKey String
[string] The public key for the WireGuard Gateway.
status String
The current status of the WireGuard Gateway Peer.
timeouts VpnWireguardPeerTimeouts
vpnWireguardPeerId String
allowedIps string[]
[list, string] A list of subnet CIDRs that are allowed to connect to the WireGuard Gateway.
description string
[string] A description of the WireGuard Gateway.
endpoint VpnWireguardPeerEndpoint
[block] An endpoint configuration block for the WireGuard Gateway. The structure of this block is as follows:
gatewayId string
[string] The ID of the WireGuard Gateway that the Peer will connect to.
location string
[string] The location of the WireGuard Gateway.
name string
[string] The human-readable name of the WireGuard Gateway.
publicKey string
[string] The public key for the WireGuard Gateway.
status string
The current status of the WireGuard Gateway Peer.
timeouts VpnWireguardPeerTimeouts
vpnWireguardPeerId string
allowed_ips Sequence[str]
[list, string] A list of subnet CIDRs that are allowed to connect to the WireGuard Gateway.
description str
[string] A description of the WireGuard Gateway.
endpoint VpnWireguardPeerEndpointArgs
[block] An endpoint configuration block for the WireGuard Gateway. The structure of this block is as follows:
gateway_id str
[string] The ID of the WireGuard Gateway that the Peer will connect to.
location str
[string] The location of the WireGuard Gateway.
name str
[string] The human-readable name of the WireGuard Gateway.
public_key str
[string] The public key for the WireGuard Gateway.
status str
The current status of the WireGuard Gateway Peer.
timeouts VpnWireguardPeerTimeoutsArgs
vpn_wireguard_peer_id str
allowedIps List<String>
[list, string] A list of subnet CIDRs that are allowed to connect to the WireGuard Gateway.
description String
[string] A description of the WireGuard Gateway.
endpoint Property Map
[block] An endpoint configuration block for the WireGuard Gateway. The structure of this block is as follows:
gatewayId String
[string] The ID of the WireGuard Gateway that the Peer will connect to.
location String
[string] The location of the WireGuard Gateway.
name String
[string] The human-readable name of the WireGuard Gateway.
publicKey String
[string] The public key for the WireGuard Gateway.
status String
The current status of the WireGuard Gateway Peer.
timeouts Property Map
vpnWireguardPeerId String

Supporting Types

VpnWireguardPeerEndpoint
, VpnWireguardPeerEndpointArgs

Host This property is required. string
[string] The hostname or IPV4 address that the WireGuard Server will connect to.
Port double
[int] The port that the WireGuard Server will connect to. Defaults to 51820.
Host This property is required. string
[string] The hostname or IPV4 address that the WireGuard Server will connect to.
Port float64
[int] The port that the WireGuard Server will connect to. Defaults to 51820.
host This property is required. String
[string] The hostname or IPV4 address that the WireGuard Server will connect to.
port Double
[int] The port that the WireGuard Server will connect to. Defaults to 51820.
host This property is required. string
[string] The hostname or IPV4 address that the WireGuard Server will connect to.
port number
[int] The port that the WireGuard Server will connect to. Defaults to 51820.
host This property is required. str
[string] The hostname or IPV4 address that the WireGuard Server will connect to.
port float
[int] The port that the WireGuard Server will connect to. Defaults to 51820.
host This property is required. String
[string] The hostname or IPV4 address that the WireGuard Server will connect to.
port Number
[int] The port that the WireGuard Server will connect to. Defaults to 51820.

VpnWireguardPeerTimeouts
, VpnWireguardPeerTimeoutsArgs

Create string
Default string
Delete string
Update string
Create string
Default string
Delete string
Update string
create String
default_ String
delete String
update String
create string
default string
delete string
update string
create String
default String
delete String
update String

Import

WireGuard Peers can be imported using the gateway_id and id, e.g.,

$ pulumi import ionoscloud:index/vpnWireguardPeer:VpnWireguardPeer example gateway_id:peer_id
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
ionoscloud ionos-cloud/terraform-provider-ionoscloud
License
Notes
This Pulumi package is based on the ionoscloud Terraform Provider.