ServiceRoute resource
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as scm from "@pulumi/scm";
const srEthernetInterface1 = new scm.EthernetInterface("sr_ethernet_interface_1", {
name: "$layer3_sr_1",
comment: "Managed by Pulumi",
folder: "ngfw-shared",
linkSpeed: "auto",
linkDuplex: "full",
linkState: "auto",
layer3: {
ips: [{
name: "10.10.10.10",
}],
},
});
const srEthernetInterface2 = new scm.EthernetInterface("sr_ethernet_interface_2", {
name: "$layer3_sr_2",
comment: "Managed by Pulumi",
folder: "ngfw-shared",
linkSpeed: "auto",
linkDuplex: "full",
linkState: "auto",
layer3: {
ips: [{
name: "10.10.10.20",
}],
},
});
const srSettings = new scm.ServiceRoute("sr_settings", {
folder: "ngfw-shared",
route: {
services: [{
name: "ddns",
source: {
"interface": srEthernetInterface1.name,
address: "10.10.10.10",
},
}],
destinations: [{
name: srEthernetInterface2.name,
source: {
address: "10.10.10.20",
},
}],
},
});
import pulumi
import pulumi_scm as scm
sr_ethernet_interface1 = scm.EthernetInterface("sr_ethernet_interface_1",
name="$layer3_sr_1",
comment="Managed by Pulumi",
folder="ngfw-shared",
link_speed="auto",
link_duplex="full",
link_state="auto",
layer3={
"ips": [{
"name": "10.10.10.10",
}],
})
sr_ethernet_interface2 = scm.EthernetInterface("sr_ethernet_interface_2",
name="$layer3_sr_2",
comment="Managed by Pulumi",
folder="ngfw-shared",
link_speed="auto",
link_duplex="full",
link_state="auto",
layer3={
"ips": [{
"name": "10.10.10.20",
}],
})
sr_settings = scm.ServiceRoute("sr_settings",
folder="ngfw-shared",
route={
"services": [{
"name": "ddns",
"source": {
"interface": sr_ethernet_interface1.name,
"address": "10.10.10.10",
},
}],
"destinations": [{
"name": sr_ethernet_interface2.name,
"source": {
"address": "10.10.10.20",
},
}],
})
package main
import (
"github.com/pulumi/pulumi-scm/sdk/go/scm"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
srEthernetInterface1, err := scm.NewEthernetInterface(ctx, "sr_ethernet_interface_1", &scm.EthernetInterfaceArgs{
Name: pulumi.String("$layer3_sr_1"),
Comment: pulumi.String("Managed by Pulumi"),
Folder: pulumi.String("ngfw-shared"),
LinkSpeed: pulumi.String("auto"),
LinkDuplex: pulumi.String("full"),
LinkState: pulumi.String("auto"),
Layer3: &scm.EthernetInterfaceLayer3Args{
Ips: scm.EthernetInterfaceLayer3IpArray{
&scm.EthernetInterfaceLayer3IpArgs{
Name: pulumi.String("10.10.10.10"),
},
},
},
})
if err != nil {
return err
}
srEthernetInterface2, err := scm.NewEthernetInterface(ctx, "sr_ethernet_interface_2", &scm.EthernetInterfaceArgs{
Name: pulumi.String("$layer3_sr_2"),
Comment: pulumi.String("Managed by Pulumi"),
Folder: pulumi.String("ngfw-shared"),
LinkSpeed: pulumi.String("auto"),
LinkDuplex: pulumi.String("full"),
LinkState: pulumi.String("auto"),
Layer3: &scm.EthernetInterfaceLayer3Args{
Ips: scm.EthernetInterfaceLayer3IpArray{
&scm.EthernetInterfaceLayer3IpArgs{
Name: pulumi.String("10.10.10.20"),
},
},
},
})
if err != nil {
return err
}
_, err = scm.NewServiceRoute(ctx, "sr_settings", &scm.ServiceRouteArgs{
Folder: pulumi.String("ngfw-shared"),
Route: &scm.ServiceRouteRouteArgs{
Services: scm.ServiceRouteRouteServiceArray{
&scm.ServiceRouteRouteServiceArgs{
Name: pulumi.String("ddns"),
Source: &scm.ServiceRouteRouteServiceSourceArgs{
Interface: srEthernetInterface1.Name,
Address: pulumi.String("10.10.10.10"),
},
},
},
Destinations: scm.ServiceRouteRouteDestinationArray{
&scm.ServiceRouteRouteDestinationArgs{
Name: srEthernetInterface2.Name,
Source: &scm.ServiceRouteRouteDestinationSourceArgs{
Address: pulumi.String("10.10.10.20"),
},
},
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Scm = Pulumi.Scm;
return await Deployment.RunAsync(() =>
{
var srEthernetInterface1 = new Scm.EthernetInterface("sr_ethernet_interface_1", new()
{
Name = "$layer3_sr_1",
Comment = "Managed by Pulumi",
Folder = "ngfw-shared",
LinkSpeed = "auto",
LinkDuplex = "full",
LinkState = "auto",
Layer3 = new Scm.Inputs.EthernetInterfaceLayer3Args
{
Ips = new[]
{
new Scm.Inputs.EthernetInterfaceLayer3IpArgs
{
Name = "10.10.10.10",
},
},
},
});
var srEthernetInterface2 = new Scm.EthernetInterface("sr_ethernet_interface_2", new()
{
Name = "$layer3_sr_2",
Comment = "Managed by Pulumi",
Folder = "ngfw-shared",
LinkSpeed = "auto",
LinkDuplex = "full",
LinkState = "auto",
Layer3 = new Scm.Inputs.EthernetInterfaceLayer3Args
{
Ips = new[]
{
new Scm.Inputs.EthernetInterfaceLayer3IpArgs
{
Name = "10.10.10.20",
},
},
},
});
var srSettings = new Scm.ServiceRoute("sr_settings", new()
{
Folder = "ngfw-shared",
Route = new Scm.Inputs.ServiceRouteRouteArgs
{
Services = new[]
{
new Scm.Inputs.ServiceRouteRouteServiceArgs
{
Name = "ddns",
Source = new Scm.Inputs.ServiceRouteRouteServiceSourceArgs
{
Interface = srEthernetInterface1.Name,
Address = "10.10.10.10",
},
},
},
Destinations = new[]
{
new Scm.Inputs.ServiceRouteRouteDestinationArgs
{
Name = srEthernetInterface2.Name,
Source = new Scm.Inputs.ServiceRouteRouteDestinationSourceArgs
{
Address = "10.10.10.20",
},
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.scm.EthernetInterface;
import com.pulumi.scm.EthernetInterfaceArgs;
import com.pulumi.scm.inputs.EthernetInterfaceLayer3Args;
import com.pulumi.scm.ServiceRoute;
import com.pulumi.scm.ServiceRouteArgs;
import com.pulumi.scm.inputs.ServiceRouteRouteArgs;
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 srEthernetInterface1 = new EthernetInterface("srEthernetInterface1", EthernetInterfaceArgs.builder()
.name("$layer3_sr_1")
.comment("Managed by Pulumi")
.folder("ngfw-shared")
.linkSpeed("auto")
.linkDuplex("full")
.linkState("auto")
.layer3(EthernetInterfaceLayer3Args.builder()
.ips(EthernetInterfaceLayer3IpArgs.builder()
.name("10.10.10.10")
.build())
.build())
.build());
var srEthernetInterface2 = new EthernetInterface("srEthernetInterface2", EthernetInterfaceArgs.builder()
.name("$layer3_sr_2")
.comment("Managed by Pulumi")
.folder("ngfw-shared")
.linkSpeed("auto")
.linkDuplex("full")
.linkState("auto")
.layer3(EthernetInterfaceLayer3Args.builder()
.ips(EthernetInterfaceLayer3IpArgs.builder()
.name("10.10.10.20")
.build())
.build())
.build());
var srSettings = new ServiceRoute("srSettings", ServiceRouteArgs.builder()
.folder("ngfw-shared")
.route(ServiceRouteRouteArgs.builder()
.services(ServiceRouteRouteServiceArgs.builder()
.name("ddns")
.source(ServiceRouteRouteServiceSourceArgs.builder()
.interface_(srEthernetInterface1.name())
.address("10.10.10.10")
.build())
.build())
.destinations(ServiceRouteRouteDestinationArgs.builder()
.name(srEthernetInterface2.name())
.source(ServiceRouteRouteDestinationSourceArgs.builder()
.address("10.10.10.20")
.build())
.build())
.build())
.build());
}
}
resources:
srEthernetInterface1:
type: scm:EthernetInterface
name: sr_ethernet_interface_1
properties:
name: $layer3_sr_1
comment: Managed by Pulumi
folder: ngfw-shared
linkSpeed: auto
linkDuplex: full
linkState: auto
layer3:
ips:
- name: 10.10.10.10
srEthernetInterface2:
type: scm:EthernetInterface
name: sr_ethernet_interface_2
properties:
name: $layer3_sr_2
comment: Managed by Pulumi
folder: ngfw-shared
linkSpeed: auto
linkDuplex: full
linkState: auto
layer3:
ips:
- name: 10.10.10.20
srSettings:
type: scm:ServiceRoute
name: sr_settings
properties:
folder: ngfw-shared
route:
services:
- name: ddns
source:
interface: ${srEthernetInterface1.name}
address: 10.10.10.10
destinations:
- name: ${srEthernetInterface2.name}
source:
address: 10.10.10.20
Create ServiceRoute Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ServiceRoute(name: string, args?: ServiceRouteArgs, opts?: CustomResourceOptions);@overload
def ServiceRoute(resource_name: str,
args: Optional[ServiceRouteArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def ServiceRoute(resource_name: str,
opts: Optional[ResourceOptions] = None,
device: Optional[str] = None,
folder: Optional[str] = None,
route: Optional[ServiceRouteRouteArgs] = None,
snippet: Optional[str] = None)func NewServiceRoute(ctx *Context, name string, args *ServiceRouteArgs, opts ...ResourceOption) (*ServiceRoute, error)public ServiceRoute(string name, ServiceRouteArgs? args = null, CustomResourceOptions? opts = null)
public ServiceRoute(String name, ServiceRouteArgs args)
public ServiceRoute(String name, ServiceRouteArgs args, CustomResourceOptions options)
type: scm:ServiceRoute
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 ServiceRouteArgs
- 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 ServiceRouteArgs
- 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 ServiceRouteArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ServiceRouteArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ServiceRouteArgs
- 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 serviceRouteResource = new Scm.ServiceRoute("serviceRouteResource", new()
{
Device = "string",
Folder = "string",
Route = new Scm.Inputs.ServiceRouteRouteArgs
{
Destinations = new[]
{
new Scm.Inputs.ServiceRouteRouteDestinationArgs
{
Name = "string",
Source = new Scm.Inputs.ServiceRouteRouteDestinationSourceArgs
{
Address = "string",
Interface = "string",
},
},
},
Services = new[]
{
new Scm.Inputs.ServiceRouteRouteServiceArgs
{
Name = "string",
Source = new Scm.Inputs.ServiceRouteRouteServiceSourceArgs
{
Address = "string",
Interface = "string",
},
SourceV6 = new Scm.Inputs.ServiceRouteRouteServiceSourceV6Args
{
Address = "string",
Interface = "string",
},
},
},
},
Snippet = "string",
});
example, err := scm.NewServiceRoute(ctx, "serviceRouteResource", &scm.ServiceRouteArgs{
Device: pulumi.String("string"),
Folder: pulumi.String("string"),
Route: &scm.ServiceRouteRouteArgs{
Destinations: scm.ServiceRouteRouteDestinationArray{
&scm.ServiceRouteRouteDestinationArgs{
Name: pulumi.String("string"),
Source: &scm.ServiceRouteRouteDestinationSourceArgs{
Address: pulumi.String("string"),
Interface: pulumi.String("string"),
},
},
},
Services: scm.ServiceRouteRouteServiceArray{
&scm.ServiceRouteRouteServiceArgs{
Name: pulumi.String("string"),
Source: &scm.ServiceRouteRouteServiceSourceArgs{
Address: pulumi.String("string"),
Interface: pulumi.String("string"),
},
SourceV6: &scm.ServiceRouteRouteServiceSourceV6Args{
Address: pulumi.String("string"),
Interface: pulumi.String("string"),
},
},
},
},
Snippet: pulumi.String("string"),
})
var serviceRouteResource = new ServiceRoute("serviceRouteResource", ServiceRouteArgs.builder()
.device("string")
.folder("string")
.route(ServiceRouteRouteArgs.builder()
.destinations(ServiceRouteRouteDestinationArgs.builder()
.name("string")
.source(ServiceRouteRouteDestinationSourceArgs.builder()
.address("string")
.interface_("string")
.build())
.build())
.services(ServiceRouteRouteServiceArgs.builder()
.name("string")
.source(ServiceRouteRouteServiceSourceArgs.builder()
.address("string")
.interface_("string")
.build())
.sourceV6(ServiceRouteRouteServiceSourceV6Args.builder()
.address("string")
.interface_("string")
.build())
.build())
.build())
.snippet("string")
.build());
service_route_resource = scm.ServiceRoute("serviceRouteResource",
device="string",
folder="string",
route={
"destinations": [{
"name": "string",
"source": {
"address": "string",
"interface": "string",
},
}],
"services": [{
"name": "string",
"source": {
"address": "string",
"interface": "string",
},
"source_v6": {
"address": "string",
"interface": "string",
},
}],
},
snippet="string")
const serviceRouteResource = new scm.ServiceRoute("serviceRouteResource", {
device: "string",
folder: "string",
route: {
destinations: [{
name: "string",
source: {
address: "string",
"interface": "string",
},
}],
services: [{
name: "string",
source: {
address: "string",
"interface": "string",
},
sourceV6: {
address: "string",
"interface": "string",
},
}],
},
snippet: "string",
});
type: scm:ServiceRoute
properties:
device: string
folder: string
route:
destinations:
- name: string
source:
address: string
interface: string
services:
- name: string
source:
address: string
interface: string
sourceV6:
address: string
interface: string
snippet: string
ServiceRoute 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 ServiceRoute resource accepts the following input properties:
- Device string
- The device in which the resource is defined
- Folder string
The folder in which the resource is defined
ℹ️ Note: You must specify exactly one of
device,folder, andsnippet.- Route
Service
Route Route - Route
- Snippet string
The snippet in which the resource is defined
ℹ️ Note: You must specify exactly one of
device,folder, andsnippet.
- Device string
- The device in which the resource is defined
- Folder string
The folder in which the resource is defined
ℹ️ Note: You must specify exactly one of
device,folder, andsnippet.- Route
Service
Route Route Args - Route
- Snippet string
The snippet in which the resource is defined
ℹ️ Note: You must specify exactly one of
device,folder, andsnippet.
- device String
- The device in which the resource is defined
- folder String
The folder in which the resource is defined
ℹ️ Note: You must specify exactly one of
device,folder, andsnippet.- route
Service
Route Route - Route
- snippet String
The snippet in which the resource is defined
ℹ️ Note: You must specify exactly one of
device,folder, andsnippet.
- device string
- The device in which the resource is defined
- folder string
The folder in which the resource is defined
ℹ️ Note: You must specify exactly one of
device,folder, andsnippet.- route
Service
Route Route - Route
- snippet string
The snippet in which the resource is defined
ℹ️ Note: You must specify exactly one of
device,folder, andsnippet.
- device str
- The device in which the resource is defined
- folder str
The folder in which the resource is defined
ℹ️ Note: You must specify exactly one of
device,folder, andsnippet.- route
Service
Route Route Args - Route
- snippet str
The snippet in which the resource is defined
ℹ️ Note: You must specify exactly one of
device,folder, andsnippet.
- device String
- The device in which the resource is defined
- folder String
The folder in which the resource is defined
ℹ️ Note: You must specify exactly one of
device,folder, andsnippet.- route Property Map
- Route
- snippet String
The snippet in which the resource is defined
ℹ️ Note: You must specify exactly one of
device,folder, andsnippet.
Outputs
All input properties are implicitly available as output properties. Additionally, the ServiceRoute resource produces the following output properties:
Look up Existing ServiceRoute Resource
Get an existing ServiceRoute 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?: ServiceRouteState, opts?: CustomResourceOptions): ServiceRoute@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
device: Optional[str] = None,
folder: Optional[str] = None,
route: Optional[ServiceRouteRouteArgs] = None,
snippet: Optional[str] = None,
tfid: Optional[str] = None) -> ServiceRoutefunc GetServiceRoute(ctx *Context, name string, id IDInput, state *ServiceRouteState, opts ...ResourceOption) (*ServiceRoute, error)public static ServiceRoute Get(string name, Input<string> id, ServiceRouteState? state, CustomResourceOptions? opts = null)public static ServiceRoute get(String name, Output<String> id, ServiceRouteState state, CustomResourceOptions options)resources: _: type: scm:ServiceRoute get: id: ${id}- 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.
- Device string
- The device in which the resource is defined
- Folder string
The folder in which the resource is defined
ℹ️ Note: You must specify exactly one of
device,folder, andsnippet.- Route
Service
Route Route - Route
- Snippet string
The snippet in which the resource is defined
ℹ️ Note: You must specify exactly one of
device,folder, andsnippet.- Tfid string
- Device string
- The device in which the resource is defined
- Folder string
The folder in which the resource is defined
ℹ️ Note: You must specify exactly one of
device,folder, andsnippet.- Route
Service
Route Route Args - Route
- Snippet string
The snippet in which the resource is defined
ℹ️ Note: You must specify exactly one of
device,folder, andsnippet.- Tfid string
- device String
- The device in which the resource is defined
- folder String
The folder in which the resource is defined
ℹ️ Note: You must specify exactly one of
device,folder, andsnippet.- route
Service
Route Route - Route
- snippet String
The snippet in which the resource is defined
ℹ️ Note: You must specify exactly one of
device,folder, andsnippet.- tfid String
- device string
- The device in which the resource is defined
- folder string
The folder in which the resource is defined
ℹ️ Note: You must specify exactly one of
device,folder, andsnippet.- route
Service
Route Route - Route
- snippet string
The snippet in which the resource is defined
ℹ️ Note: You must specify exactly one of
device,folder, andsnippet.- tfid string
- device str
- The device in which the resource is defined
- folder str
The folder in which the resource is defined
ℹ️ Note: You must specify exactly one of
device,folder, andsnippet.- route
Service
Route Route Args - Route
- snippet str
The snippet in which the resource is defined
ℹ️ Note: You must specify exactly one of
device,folder, andsnippet.- tfid str
- device String
- The device in which the resource is defined
- folder String
The folder in which the resource is defined
ℹ️ Note: You must specify exactly one of
device,folder, andsnippet.- route Property Map
- Route
- snippet String
The snippet in which the resource is defined
ℹ️ Note: You must specify exactly one of
device,folder, andsnippet.- tfid String
Supporting Types
ServiceRouteRoute, ServiceRouteRouteArgs
- Destinations
[]Service
Route Route Destination - Destination
- Services
[]Service
Route Route Service - Service
- destinations
Service
Route Route Destination[] - Destination
- services
Service
Route Route Service[] - Service
- destinations List<Property Map>
- Destination
- services List<Property Map>
- Service
ServiceRouteRouteDestination, ServiceRouteRouteDestinationArgs
- Name string
- Name
- Source
Service
Route Route Destination Source - Source
- Name string
- Name
- Source
Service
Route Route Destination Source - Source
- name String
- Name
- source
Service
Route Route Destination Source - Source
- name string
- Name
- source
Service
Route Route Destination Source - Source
- name str
- Name
- source
Service
Route Route Destination Source - Source
- name String
- Name
- source Property Map
- Source
ServiceRouteRouteDestinationSource, ServiceRouteRouteDestinationSourceArgs
- address String
- Address
- interface_ String
- Interface
ServiceRouteRouteService, ServiceRouteRouteServiceArgs
- Name string
- The follow list details the accepted
namevalues and their corresponding service description. - Source
Service
Route Route Service Source - Source
- Source
V6 ServiceRoute Route Service Source V6 - Source v6
- Name string
- The follow list details the accepted
namevalues and their corresponding service description. - Source
Service
Route Route Service Source - Source
- Source
V6 ServiceRoute Route Service Source V6 - Source v6
- name String
- The follow list details the accepted
namevalues and their corresponding service description. - source
Service
Route Route Service Source - Source
- source
V6 ServiceRoute Route Service Source V6 - Source v6
- name string
- The follow list details the accepted
namevalues and their corresponding service description. - source
Service
Route Route Service Source - Source
- source
V6 ServiceRoute Route Service Source V6 - Source v6
- name str
- The follow list details the accepted
namevalues and their corresponding service description. - source
Service
Route Route Service Source - Source
- source_
v6 ServiceRoute Route Service Source V6 - Source v6
- name String
- The follow list details the accepted
namevalues and their corresponding service description. - source Property Map
- Source
- source
V6 Property Map - Source v6
ServiceRouteRouteServiceSource, ServiceRouteRouteServiceSourceArgs
- address String
- Address
- interface_ String
- Interface
ServiceRouteRouteServiceSourceV6, ServiceRouteRouteServiceSourceV6Args
- address String
- Address
- interface_ String
- Interface
Import
The following command can be used to import a resource not managed by Terraform:
bash
$ pulumi import scm:index/serviceRoute:ServiceRoute example folder:::id
or
bash
$ pulumi import scm:index/serviceRoute:ServiceRoute example :snippet::id
or
bash
$ pulumi import scm:index/serviceRoute:ServiceRoute example ::device:id
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- scm pulumi/pulumi-scm
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
scmTerraform Provider.
