1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. GreTunnel
Cloudflare v5.49.1 published on Tuesday, Feb 18, 2025 by Pulumi

cloudflare.GreTunnel

Explore with Pulumi AI

Provides a resource, that manages GRE tunnels for Magic Transit.

Example Usage

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

const example = new cloudflare.GreTunnel("example", {
    accountId: "f037e56e89293a057740de681ac9abbe",
    name: "GRE_1",
    customerGreEndpoint: "203.0.113.1",
    cloudflareGreEndpoint: "203.0.113.2",
    interfaceAddress: "192.0.2.0/31",
    description: "Tunnel for ISP X",
    ttl: 64,
    mtu: 1476,
    healthCheckEnabled: true,
    healthCheckTarget: "203.0.113.1",
    healthCheckType: "reply",
});
Copy
import pulumi
import pulumi_cloudflare as cloudflare

example = cloudflare.GreTunnel("example",
    account_id="f037e56e89293a057740de681ac9abbe",
    name="GRE_1",
    customer_gre_endpoint="203.0.113.1",
    cloudflare_gre_endpoint="203.0.113.2",
    interface_address="192.0.2.0/31",
    description="Tunnel for ISP X",
    ttl=64,
    mtu=1476,
    health_check_enabled=True,
    health_check_target="203.0.113.1",
    health_check_type="reply")
Copy
package main

import (
	"github.com/pulumi/pulumi-cloudflare/sdk/v5/go/cloudflare"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cloudflare.NewGreTunnel(ctx, "example", &cloudflare.GreTunnelArgs{
			AccountId:             pulumi.String("f037e56e89293a057740de681ac9abbe"),
			Name:                  pulumi.String("GRE_1"),
			CustomerGreEndpoint:   pulumi.String("203.0.113.1"),
			CloudflareGreEndpoint: pulumi.String("203.0.113.2"),
			InterfaceAddress:      pulumi.String("192.0.2.0/31"),
			Description:           pulumi.String("Tunnel for ISP X"),
			Ttl:                   pulumi.Int(64),
			Mtu:                   pulumi.Int(1476),
			HealthCheckEnabled:    pulumi.Bool(true),
			HealthCheckTarget:     pulumi.String("203.0.113.1"),
			HealthCheckType:       pulumi.String("reply"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;

return await Deployment.RunAsync(() => 
{
    var example = new Cloudflare.GreTunnel("example", new()
    {
        AccountId = "f037e56e89293a057740de681ac9abbe",
        Name = "GRE_1",
        CustomerGreEndpoint = "203.0.113.1",
        CloudflareGreEndpoint = "203.0.113.2",
        InterfaceAddress = "192.0.2.0/31",
        Description = "Tunnel for ISP X",
        Ttl = 64,
        Mtu = 1476,
        HealthCheckEnabled = true,
        HealthCheckTarget = "203.0.113.1",
        HealthCheckType = "reply",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudflare.GreTunnel;
import com.pulumi.cloudflare.GreTunnelArgs;
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 GreTunnel("example", GreTunnelArgs.builder()
            .accountId("f037e56e89293a057740de681ac9abbe")
            .name("GRE_1")
            .customerGreEndpoint("203.0.113.1")
            .cloudflareGreEndpoint("203.0.113.2")
            .interfaceAddress("192.0.2.0/31")
            .description("Tunnel for ISP X")
            .ttl(64)
            .mtu(1476)
            .healthCheckEnabled(true)
            .healthCheckTarget("203.0.113.1")
            .healthCheckType("reply")
            .build());

    }
}
Copy
resources:
  example:
    type: cloudflare:GreTunnel
    properties:
      accountId: f037e56e89293a057740de681ac9abbe
      name: GRE_1
      customerGreEndpoint: 203.0.113.1
      cloudflareGreEndpoint: 203.0.113.2
      interfaceAddress: 192.0.2.0/31
      description: Tunnel for ISP X
      ttl: 64
      mtu: 1476
      healthCheckEnabled: true
      healthCheckTarget: 203.0.113.1
      healthCheckType: reply
Copy

Create GreTunnel Resource

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

Constructor syntax

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

@overload
def GreTunnel(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              cloudflare_gre_endpoint: Optional[str] = None,
              customer_gre_endpoint: Optional[str] = None,
              interface_address: Optional[str] = None,
              name: Optional[str] = None,
              account_id: Optional[str] = None,
              description: Optional[str] = None,
              health_check_enabled: Optional[bool] = None,
              health_check_target: Optional[str] = None,
              health_check_type: Optional[str] = None,
              mtu: Optional[int] = None,
              ttl: Optional[int] = None)
func NewGreTunnel(ctx *Context, name string, args GreTunnelArgs, opts ...ResourceOption) (*GreTunnel, error)
public GreTunnel(string name, GreTunnelArgs args, CustomResourceOptions? opts = null)
public GreTunnel(String name, GreTunnelArgs args)
public GreTunnel(String name, GreTunnelArgs args, CustomResourceOptions options)
type: cloudflare:GreTunnel
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. GreTunnelArgs
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. GreTunnelArgs
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. GreTunnelArgs
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. GreTunnelArgs
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. GreTunnelArgs
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 greTunnelResource = new Cloudflare.GreTunnel("greTunnelResource", new()
{
    CloudflareGreEndpoint = "string",
    CustomerGreEndpoint = "string",
    InterfaceAddress = "string",
    Name = "string",
    AccountId = "string",
    Description = "string",
    HealthCheckEnabled = false,
    HealthCheckTarget = "string",
    HealthCheckType = "string",
    Mtu = 0,
    Ttl = 0,
});
Copy
example, err := cloudflare.NewGreTunnel(ctx, "greTunnelResource", &cloudflare.GreTunnelArgs{
	CloudflareGreEndpoint: pulumi.String("string"),
	CustomerGreEndpoint:   pulumi.String("string"),
	InterfaceAddress:      pulumi.String("string"),
	Name:                  pulumi.String("string"),
	AccountId:             pulumi.String("string"),
	Description:           pulumi.String("string"),
	HealthCheckEnabled:    pulumi.Bool(false),
	HealthCheckTarget:     pulumi.String("string"),
	HealthCheckType:       pulumi.String("string"),
	Mtu:                   pulumi.Int(0),
	Ttl:                   pulumi.Int(0),
})
Copy
var greTunnelResource = new GreTunnel("greTunnelResource", GreTunnelArgs.builder()
    .cloudflareGreEndpoint("string")
    .customerGreEndpoint("string")
    .interfaceAddress("string")
    .name("string")
    .accountId("string")
    .description("string")
    .healthCheckEnabled(false)
    .healthCheckTarget("string")
    .healthCheckType("string")
    .mtu(0)
    .ttl(0)
    .build());
Copy
gre_tunnel_resource = cloudflare.GreTunnel("greTunnelResource",
    cloudflare_gre_endpoint="string",
    customer_gre_endpoint="string",
    interface_address="string",
    name="string",
    account_id="string",
    description="string",
    health_check_enabled=False,
    health_check_target="string",
    health_check_type="string",
    mtu=0,
    ttl=0)
Copy
const greTunnelResource = new cloudflare.GreTunnel("greTunnelResource", {
    cloudflareGreEndpoint: "string",
    customerGreEndpoint: "string",
    interfaceAddress: "string",
    name: "string",
    accountId: "string",
    description: "string",
    healthCheckEnabled: false,
    healthCheckTarget: "string",
    healthCheckType: "string",
    mtu: 0,
    ttl: 0,
});
Copy
type: cloudflare:GreTunnel
properties:
    accountId: string
    cloudflareGreEndpoint: string
    customerGreEndpoint: string
    description: string
    healthCheckEnabled: false
    healthCheckTarget: string
    healthCheckType: string
    interfaceAddress: string
    mtu: 0
    name: string
    ttl: 0
Copy

GreTunnel 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 GreTunnel resource accepts the following input properties:

CloudflareGreEndpoint This property is required. string
The IP address assigned to the Cloudflare side of the GRE tunnel.
CustomerGreEndpoint This property is required. string
The IP address assigned to the customer side of the GRE tunnel.
InterfaceAddress This property is required. string
31-bit prefix (/31 in CIDR notation) supporting 2 hosts, one for each side of the tunnel.
Name This property is required. string
Name of the GRE tunnel.
AccountId Changes to this property will trigger replacement. string
The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
Description string
Description of the GRE tunnel intent.
HealthCheckEnabled bool
Specifies if ICMP tunnel health checks are enabled.
HealthCheckTarget string
The IP address of the customer endpoint that will receive tunnel health checks.
HealthCheckType string
Specifies the ICMP echo type for the health check. Available values: request, reply.
Mtu int
Maximum Transmission Unit (MTU) in bytes for the GRE tunnel.
Ttl int
Time To Live (TTL) in number of hops of the GRE tunnel.
CloudflareGreEndpoint This property is required. string
The IP address assigned to the Cloudflare side of the GRE tunnel.
CustomerGreEndpoint This property is required. string
The IP address assigned to the customer side of the GRE tunnel.
InterfaceAddress This property is required. string
31-bit prefix (/31 in CIDR notation) supporting 2 hosts, one for each side of the tunnel.
Name This property is required. string
Name of the GRE tunnel.
AccountId Changes to this property will trigger replacement. string
The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
Description string
Description of the GRE tunnel intent.
HealthCheckEnabled bool
Specifies if ICMP tunnel health checks are enabled.
HealthCheckTarget string
The IP address of the customer endpoint that will receive tunnel health checks.
HealthCheckType string
Specifies the ICMP echo type for the health check. Available values: request, reply.
Mtu int
Maximum Transmission Unit (MTU) in bytes for the GRE tunnel.
Ttl int
Time To Live (TTL) in number of hops of the GRE tunnel.
cloudflareGreEndpoint This property is required. String
The IP address assigned to the Cloudflare side of the GRE tunnel.
customerGreEndpoint This property is required. String
The IP address assigned to the customer side of the GRE tunnel.
interfaceAddress This property is required. String
31-bit prefix (/31 in CIDR notation) supporting 2 hosts, one for each side of the tunnel.
name This property is required. String
Name of the GRE tunnel.
accountId Changes to this property will trigger replacement. String
The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
description String
Description of the GRE tunnel intent.
healthCheckEnabled Boolean
Specifies if ICMP tunnel health checks are enabled.
healthCheckTarget String
The IP address of the customer endpoint that will receive tunnel health checks.
healthCheckType String
Specifies the ICMP echo type for the health check. Available values: request, reply.
mtu Integer
Maximum Transmission Unit (MTU) in bytes for the GRE tunnel.
ttl Integer
Time To Live (TTL) in number of hops of the GRE tunnel.
cloudflareGreEndpoint This property is required. string
The IP address assigned to the Cloudflare side of the GRE tunnel.
customerGreEndpoint This property is required. string
The IP address assigned to the customer side of the GRE tunnel.
interfaceAddress This property is required. string
31-bit prefix (/31 in CIDR notation) supporting 2 hosts, one for each side of the tunnel.
name This property is required. string
Name of the GRE tunnel.
accountId Changes to this property will trigger replacement. string
The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
description string
Description of the GRE tunnel intent.
healthCheckEnabled boolean
Specifies if ICMP tunnel health checks are enabled.
healthCheckTarget string
The IP address of the customer endpoint that will receive tunnel health checks.
healthCheckType string
Specifies the ICMP echo type for the health check. Available values: request, reply.
mtu number
Maximum Transmission Unit (MTU) in bytes for the GRE tunnel.
ttl number
Time To Live (TTL) in number of hops of the GRE tunnel.
cloudflare_gre_endpoint This property is required. str
The IP address assigned to the Cloudflare side of the GRE tunnel.
customer_gre_endpoint This property is required. str
The IP address assigned to the customer side of the GRE tunnel.
interface_address This property is required. str
31-bit prefix (/31 in CIDR notation) supporting 2 hosts, one for each side of the tunnel.
name This property is required. str
Name of the GRE tunnel.
account_id Changes to this property will trigger replacement. str
The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
description str
Description of the GRE tunnel intent.
health_check_enabled bool
Specifies if ICMP tunnel health checks are enabled.
health_check_target str
The IP address of the customer endpoint that will receive tunnel health checks.
health_check_type str
Specifies the ICMP echo type for the health check. Available values: request, reply.
mtu int
Maximum Transmission Unit (MTU) in bytes for the GRE tunnel.
ttl int
Time To Live (TTL) in number of hops of the GRE tunnel.
cloudflareGreEndpoint This property is required. String
The IP address assigned to the Cloudflare side of the GRE tunnel.
customerGreEndpoint This property is required. String
The IP address assigned to the customer side of the GRE tunnel.
interfaceAddress This property is required. String
31-bit prefix (/31 in CIDR notation) supporting 2 hosts, one for each side of the tunnel.
name This property is required. String
Name of the GRE tunnel.
accountId Changes to this property will trigger replacement. String
The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
description String
Description of the GRE tunnel intent.
healthCheckEnabled Boolean
Specifies if ICMP tunnel health checks are enabled.
healthCheckTarget String
The IP address of the customer endpoint that will receive tunnel health checks.
healthCheckType String
Specifies the ICMP echo type for the health check. Available values: request, reply.
mtu Number
Maximum Transmission Unit (MTU) in bytes for the GRE tunnel.
ttl Number
Time To Live (TTL) in number of hops of the GRE tunnel.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing GreTunnel Resource

Get an existing GreTunnel 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?: GreTunnelState, opts?: CustomResourceOptions): GreTunnel
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        account_id: Optional[str] = None,
        cloudflare_gre_endpoint: Optional[str] = None,
        customer_gre_endpoint: Optional[str] = None,
        description: Optional[str] = None,
        health_check_enabled: Optional[bool] = None,
        health_check_target: Optional[str] = None,
        health_check_type: Optional[str] = None,
        interface_address: Optional[str] = None,
        mtu: Optional[int] = None,
        name: Optional[str] = None,
        ttl: Optional[int] = None) -> GreTunnel
func GetGreTunnel(ctx *Context, name string, id IDInput, state *GreTunnelState, opts ...ResourceOption) (*GreTunnel, error)
public static GreTunnel Get(string name, Input<string> id, GreTunnelState? state, CustomResourceOptions? opts = null)
public static GreTunnel get(String name, Output<String> id, GreTunnelState state, CustomResourceOptions options)
resources:  _:    type: cloudflare:GreTunnel    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:
AccountId Changes to this property will trigger replacement. string
The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
CloudflareGreEndpoint string
The IP address assigned to the Cloudflare side of the GRE tunnel.
CustomerGreEndpoint string
The IP address assigned to the customer side of the GRE tunnel.
Description string
Description of the GRE tunnel intent.
HealthCheckEnabled bool
Specifies if ICMP tunnel health checks are enabled.
HealthCheckTarget string
The IP address of the customer endpoint that will receive tunnel health checks.
HealthCheckType string
Specifies the ICMP echo type for the health check. Available values: request, reply.
InterfaceAddress string
31-bit prefix (/31 in CIDR notation) supporting 2 hosts, one for each side of the tunnel.
Mtu int
Maximum Transmission Unit (MTU) in bytes for the GRE tunnel.
Name string
Name of the GRE tunnel.
Ttl int
Time To Live (TTL) in number of hops of the GRE tunnel.
AccountId Changes to this property will trigger replacement. string
The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
CloudflareGreEndpoint string
The IP address assigned to the Cloudflare side of the GRE tunnel.
CustomerGreEndpoint string
The IP address assigned to the customer side of the GRE tunnel.
Description string
Description of the GRE tunnel intent.
HealthCheckEnabled bool
Specifies if ICMP tunnel health checks are enabled.
HealthCheckTarget string
The IP address of the customer endpoint that will receive tunnel health checks.
HealthCheckType string
Specifies the ICMP echo type for the health check. Available values: request, reply.
InterfaceAddress string
31-bit prefix (/31 in CIDR notation) supporting 2 hosts, one for each side of the tunnel.
Mtu int
Maximum Transmission Unit (MTU) in bytes for the GRE tunnel.
Name string
Name of the GRE tunnel.
Ttl int
Time To Live (TTL) in number of hops of the GRE tunnel.
accountId Changes to this property will trigger replacement. String
The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
cloudflareGreEndpoint String
The IP address assigned to the Cloudflare side of the GRE tunnel.
customerGreEndpoint String
The IP address assigned to the customer side of the GRE tunnel.
description String
Description of the GRE tunnel intent.
healthCheckEnabled Boolean
Specifies if ICMP tunnel health checks are enabled.
healthCheckTarget String
The IP address of the customer endpoint that will receive tunnel health checks.
healthCheckType String
Specifies the ICMP echo type for the health check. Available values: request, reply.
interfaceAddress String
31-bit prefix (/31 in CIDR notation) supporting 2 hosts, one for each side of the tunnel.
mtu Integer
Maximum Transmission Unit (MTU) in bytes for the GRE tunnel.
name String
Name of the GRE tunnel.
ttl Integer
Time To Live (TTL) in number of hops of the GRE tunnel.
accountId Changes to this property will trigger replacement. string
The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
cloudflareGreEndpoint string
The IP address assigned to the Cloudflare side of the GRE tunnel.
customerGreEndpoint string
The IP address assigned to the customer side of the GRE tunnel.
description string
Description of the GRE tunnel intent.
healthCheckEnabled boolean
Specifies if ICMP tunnel health checks are enabled.
healthCheckTarget string
The IP address of the customer endpoint that will receive tunnel health checks.
healthCheckType string
Specifies the ICMP echo type for the health check. Available values: request, reply.
interfaceAddress string
31-bit prefix (/31 in CIDR notation) supporting 2 hosts, one for each side of the tunnel.
mtu number
Maximum Transmission Unit (MTU) in bytes for the GRE tunnel.
name string
Name of the GRE tunnel.
ttl number
Time To Live (TTL) in number of hops of the GRE tunnel.
account_id Changes to this property will trigger replacement. str
The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
cloudflare_gre_endpoint str
The IP address assigned to the Cloudflare side of the GRE tunnel.
customer_gre_endpoint str
The IP address assigned to the customer side of the GRE tunnel.
description str
Description of the GRE tunnel intent.
health_check_enabled bool
Specifies if ICMP tunnel health checks are enabled.
health_check_target str
The IP address of the customer endpoint that will receive tunnel health checks.
health_check_type str
Specifies the ICMP echo type for the health check. Available values: request, reply.
interface_address str
31-bit prefix (/31 in CIDR notation) supporting 2 hosts, one for each side of the tunnel.
mtu int
Maximum Transmission Unit (MTU) in bytes for the GRE tunnel.
name str
Name of the GRE tunnel.
ttl int
Time To Live (TTL) in number of hops of the GRE tunnel.
accountId Changes to this property will trigger replacement. String
The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
cloudflareGreEndpoint String
The IP address assigned to the Cloudflare side of the GRE tunnel.
customerGreEndpoint String
The IP address assigned to the customer side of the GRE tunnel.
description String
Description of the GRE tunnel intent.
healthCheckEnabled Boolean
Specifies if ICMP tunnel health checks are enabled.
healthCheckTarget String
The IP address of the customer endpoint that will receive tunnel health checks.
healthCheckType String
Specifies the ICMP echo type for the health check. Available values: request, reply.
interfaceAddress String
31-bit prefix (/31 in CIDR notation) supporting 2 hosts, one for each side of the tunnel.
mtu Number
Maximum Transmission Unit (MTU) in bytes for the GRE tunnel.
name String
Name of the GRE tunnel.
ttl Number
Time To Live (TTL) in number of hops of the GRE tunnel.

Import

$ pulumi import cloudflare:index/greTunnel:GreTunnel example <account_id>/<tunnel_id>
Copy

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

Package Details

Repository
Cloudflare pulumi/pulumi-cloudflare
License
Apache-2.0
Notes
This Pulumi package is based on the cloudflare Terraform Provider.