cloudflare.MagicWanStaticRoute
Explore with Pulumi AI
Provides a resource, that manages Cloudflare static routes for Magic Transit or Magic WAN. Static routes are used to route traffic through GRE tunnels.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";
const example = new cloudflare.MagicWanStaticRoute("example", {
accountId: "f037e56e89293a057740de681ac9abbe",
description: "New route for new prefix 192.0.2.0/24",
prefix: "192.0.2.0/24",
nexthop: "10.0.0.0",
priority: 100,
weight: 10,
coloNames: ["den01"],
coloRegions: ["APAC"],
});
import pulumi
import pulumi_cloudflare as cloudflare
example = cloudflare.MagicWanStaticRoute("example",
account_id="f037e56e89293a057740de681ac9abbe",
description="New route for new prefix 192.0.2.0/24",
prefix="192.0.2.0/24",
nexthop="10.0.0.0",
priority=100,
weight=10,
colo_names=["den01"],
colo_regions=["APAC"])
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.NewMagicWanStaticRoute(ctx, "example", &cloudflare.MagicWanStaticRouteArgs{
AccountId: pulumi.String("f037e56e89293a057740de681ac9abbe"),
Description: pulumi.String("New route for new prefix 192.0.2.0/24"),
Prefix: pulumi.String("192.0.2.0/24"),
Nexthop: pulumi.String("10.0.0.0"),
Priority: pulumi.Int(100),
Weight: pulumi.Int(10),
ColoNames: pulumi.StringArray{
pulumi.String("den01"),
},
ColoRegions: pulumi.StringArray{
pulumi.String("APAC"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;
return await Deployment.RunAsync(() =>
{
var example = new Cloudflare.MagicWanStaticRoute("example", new()
{
AccountId = "f037e56e89293a057740de681ac9abbe",
Description = "New route for new prefix 192.0.2.0/24",
Prefix = "192.0.2.0/24",
Nexthop = "10.0.0.0",
Priority = 100,
Weight = 10,
ColoNames = new[]
{
"den01",
},
ColoRegions = new[]
{
"APAC",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudflare.MagicWanStaticRoute;
import com.pulumi.cloudflare.MagicWanStaticRouteArgs;
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 MagicWanStaticRoute("example", MagicWanStaticRouteArgs.builder()
.accountId("f037e56e89293a057740de681ac9abbe")
.description("New route for new prefix 192.0.2.0/24")
.prefix("192.0.2.0/24")
.nexthop("10.0.0.0")
.priority(100)
.weight(10)
.coloNames("den01")
.coloRegions("APAC")
.build());
}
}
resources:
example:
type: cloudflare:MagicWanStaticRoute
properties:
accountId: f037e56e89293a057740de681ac9abbe
description: New route for new prefix 192.0.2.0/24
prefix: 192.0.2.0/24
nexthop: 10.0.0.0
priority: 100
weight: 10
coloNames:
- den01
coloRegions:
- APAC
Create MagicWanStaticRoute Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new MagicWanStaticRoute(name: string, args: MagicWanStaticRouteArgs, opts?: CustomResourceOptions);
@overload
def MagicWanStaticRoute(resource_name: str,
args: MagicWanStaticRouteArgs,
opts: Optional[ResourceOptions] = None)
@overload
def MagicWanStaticRoute(resource_name: str,
opts: Optional[ResourceOptions] = None,
nexthop: Optional[str] = None,
prefix: Optional[str] = None,
priority: Optional[int] = None,
account_id: Optional[str] = None,
colo_names: Optional[Sequence[str]] = None,
colo_regions: Optional[Sequence[str]] = None,
description: Optional[str] = None,
weight: Optional[int] = None)
func NewMagicWanStaticRoute(ctx *Context, name string, args MagicWanStaticRouteArgs, opts ...ResourceOption) (*MagicWanStaticRoute, error)
public MagicWanStaticRoute(string name, MagicWanStaticRouteArgs args, CustomResourceOptions? opts = null)
public MagicWanStaticRoute(String name, MagicWanStaticRouteArgs args)
public MagicWanStaticRoute(String name, MagicWanStaticRouteArgs args, CustomResourceOptions options)
type: cloudflare:MagicWanStaticRoute
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args MagicWanStaticRouteArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args MagicWanStaticRouteArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args MagicWanStaticRouteArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args MagicWanStaticRouteArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args MagicWanStaticRouteArgs
- 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 magicWanStaticRouteResource = new Cloudflare.MagicWanStaticRoute("magicWanStaticRouteResource", new()
{
Nexthop = "string",
Prefix = "string",
Priority = 0,
AccountId = "string",
ColoNames = new[]
{
"string",
},
ColoRegions = new[]
{
"string",
},
Description = "string",
Weight = 0,
});
example, err := cloudflare.NewMagicWanStaticRoute(ctx, "magicWanStaticRouteResource", &cloudflare.MagicWanStaticRouteArgs{
Nexthop: pulumi.String("string"),
Prefix: pulumi.String("string"),
Priority: pulumi.Int(0),
AccountId: pulumi.String("string"),
ColoNames: pulumi.StringArray{
pulumi.String("string"),
},
ColoRegions: pulumi.StringArray{
pulumi.String("string"),
},
Description: pulumi.String("string"),
Weight: pulumi.Int(0),
})
var magicWanStaticRouteResource = new MagicWanStaticRoute("magicWanStaticRouteResource", MagicWanStaticRouteArgs.builder()
.nexthop("string")
.prefix("string")
.priority(0)
.accountId("string")
.coloNames("string")
.coloRegions("string")
.description("string")
.weight(0)
.build());
magic_wan_static_route_resource = cloudflare.MagicWanStaticRoute("magicWanStaticRouteResource",
nexthop="string",
prefix="string",
priority=0,
account_id="string",
colo_names=["string"],
colo_regions=["string"],
description="string",
weight=0)
const magicWanStaticRouteResource = new cloudflare.MagicWanStaticRoute("magicWanStaticRouteResource", {
nexthop: "string",
prefix: "string",
priority: 0,
accountId: "string",
coloNames: ["string"],
coloRegions: ["string"],
description: "string",
weight: 0,
});
type: cloudflare:MagicWanStaticRoute
properties:
accountId: string
coloNames:
- string
coloRegions:
- string
description: string
nexthop: string
prefix: string
priority: 0
weight: 0
MagicWanStaticRoute Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The MagicWanStaticRoute resource accepts the following input properties:
- Nexthop string
- The nexthop IP address where traffic will be routed to.
- Prefix string
- Your network prefix using CIDR notation.
- Priority int
- The priority for the static route.
- Account
Id string - The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- Colo
Names List<string> - List of Cloudflare colocation regions for this static route.
- Colo
Regions List<string> - List of Cloudflare colocation names for this static route.
- Description string
- Description of the static route.
- Weight int
- The optional weight for ECMP routes. Modifying this attribute will force creation of a new resource.
- Nexthop string
- The nexthop IP address where traffic will be routed to.
- Prefix string
- Your network prefix using CIDR notation.
- Priority int
- The priority for the static route.
- Account
Id string - The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- Colo
Names []string - List of Cloudflare colocation regions for this static route.
- Colo
Regions []string - List of Cloudflare colocation names for this static route.
- Description string
- Description of the static route.
- Weight int
- The optional weight for ECMP routes. Modifying this attribute will force creation of a new resource.
- nexthop String
- The nexthop IP address where traffic will be routed to.
- prefix String
- Your network prefix using CIDR notation.
- priority Integer
- The priority for the static route.
- account
Id String - The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- colo
Names List<String> - List of Cloudflare colocation regions for this static route.
- colo
Regions List<String> - List of Cloudflare colocation names for this static route.
- description String
- Description of the static route.
- weight Integer
- The optional weight for ECMP routes. Modifying this attribute will force creation of a new resource.
- nexthop string
- The nexthop IP address where traffic will be routed to.
- prefix string
- Your network prefix using CIDR notation.
- priority number
- The priority for the static route.
- account
Id string - The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- colo
Names string[] - List of Cloudflare colocation regions for this static route.
- colo
Regions string[] - List of Cloudflare colocation names for this static route.
- description string
- Description of the static route.
- weight number
- The optional weight for ECMP routes. Modifying this attribute will force creation of a new resource.
- nexthop str
- The nexthop IP address where traffic will be routed to.
- prefix str
- Your network prefix using CIDR notation.
- priority int
- The priority for the static route.
- account_
id str - The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- colo_
names Sequence[str] - List of Cloudflare colocation regions for this static route.
- colo_
regions Sequence[str] - List of Cloudflare colocation names for this static route.
- description str
- Description of the static route.
- weight int
- The optional weight for ECMP routes. Modifying this attribute will force creation of a new resource.
- nexthop String
- The nexthop IP address where traffic will be routed to.
- prefix String
- Your network prefix using CIDR notation.
- priority Number
- The priority for the static route.
- account
Id String - The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- colo
Names List<String> - List of Cloudflare colocation regions for this static route.
- colo
Regions List<String> - List of Cloudflare colocation names for this static route.
- description String
- Description of the static route.
- weight Number
- The optional weight for ECMP routes. Modifying this attribute will force creation of a new resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the MagicWanStaticRoute 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 MagicWanStaticRoute Resource
Get an existing MagicWanStaticRoute 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?: MagicWanStaticRouteState, opts?: CustomResourceOptions): MagicWanStaticRoute
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
account_id: Optional[str] = None,
colo_names: Optional[Sequence[str]] = None,
colo_regions: Optional[Sequence[str]] = None,
description: Optional[str] = None,
nexthop: Optional[str] = None,
prefix: Optional[str] = None,
priority: Optional[int] = None,
weight: Optional[int] = None) -> MagicWanStaticRoute
func GetMagicWanStaticRoute(ctx *Context, name string, id IDInput, state *MagicWanStaticRouteState, opts ...ResourceOption) (*MagicWanStaticRoute, error)
public static MagicWanStaticRoute Get(string name, Input<string> id, MagicWanStaticRouteState? state, CustomResourceOptions? opts = null)
public static MagicWanStaticRoute get(String name, Output<String> id, MagicWanStaticRouteState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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.
- Account
Id string - The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- Colo
Names List<string> - List of Cloudflare colocation regions for this static route.
- Colo
Regions List<string> - List of Cloudflare colocation names for this static route.
- Description string
- Description of the static route.
- Nexthop string
- The nexthop IP address where traffic will be routed to.
- Prefix string
- Your network prefix using CIDR notation.
- Priority int
- The priority for the static route.
- Weight int
- The optional weight for ECMP routes. Modifying this attribute will force creation of a new resource.
- Account
Id string - The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- Colo
Names []string - List of Cloudflare colocation regions for this static route.
- Colo
Regions []string - List of Cloudflare colocation names for this static route.
- Description string
- Description of the static route.
- Nexthop string
- The nexthop IP address where traffic will be routed to.
- Prefix string
- Your network prefix using CIDR notation.
- Priority int
- The priority for the static route.
- Weight int
- The optional weight for ECMP routes. Modifying this attribute will force creation of a new resource.
- account
Id String - The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- colo
Names List<String> - List of Cloudflare colocation regions for this static route.
- colo
Regions List<String> - List of Cloudflare colocation names for this static route.
- description String
- Description of the static route.
- nexthop String
- The nexthop IP address where traffic will be routed to.
- prefix String
- Your network prefix using CIDR notation.
- priority Integer
- The priority for the static route.
- weight Integer
- The optional weight for ECMP routes. Modifying this attribute will force creation of a new resource.
- account
Id string - The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- colo
Names string[] - List of Cloudflare colocation regions for this static route.
- colo
Regions string[] - List of Cloudflare colocation names for this static route.
- description string
- Description of the static route.
- nexthop string
- The nexthop IP address where traffic will be routed to.
- prefix string
- Your network prefix using CIDR notation.
- priority number
- The priority for the static route.
- weight number
- The optional weight for ECMP routes. Modifying this attribute will force creation of a new resource.
- account_
id str - The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- colo_
names Sequence[str] - List of Cloudflare colocation regions for this static route.
- colo_
regions Sequence[str] - List of Cloudflare colocation names for this static route.
- description str
- Description of the static route.
- nexthop str
- The nexthop IP address where traffic will be routed to.
- prefix str
- Your network prefix using CIDR notation.
- priority int
- The priority for the static route.
- weight int
- The optional weight for ECMP routes. Modifying this attribute will force creation of a new resource.
- account
Id String - The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- colo
Names List<String> - List of Cloudflare colocation regions for this static route.
- colo
Regions List<String> - List of Cloudflare colocation names for this static route.
- description String
- Description of the static route.
- nexthop String
- The nexthop IP address where traffic will be routed to.
- prefix String
- Your network prefix using CIDR notation.
- priority Number
- The priority for the static route.
- weight Number
- The optional weight for ECMP routes. Modifying this attribute will force creation of a new resource.
Import
$ pulumi import cloudflare:index/magicWanStaticRoute:MagicWanStaticRoute example <account_id>/<static_route_id>
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.