Service resource
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as scm from "@pulumi/scm";
// TCP Service with multiple destination ports custom timeout
const scmServiceTcpPorts = new scm.Service("scm_service_tcp_ports", {
folder: "Shared",
name: "scm_service_tcp_ports",
description: "Managed by Pulumi",
protocol: {
tcp: {
port: "80,443",
override: {
timeout: 3600,
},
},
},
});
// TCP Service with source port, destination port and custom timeout values
const scmServiceTcpPortSrcDst = new scm.Service("scm_service_tcp_port_src_dst", {
folder: "Shared",
name: "scm_service_tcp_port_src_dst",
description: "Managed by Pulumi",
protocol: {
tcp: {
port: "80",
sourcePort: "49152-65535",
override: {
timeout: 3600,
halfcloseTimeout: 240,
timewaitTimeout: 30,
},
},
},
});
// UDP Service with single destination port
const scmServiceUdpPort = new scm.Service("scm_service_udp_port", {
folder: "Shared",
name: "scm_service_udp_port",
description: "Managed by Pulumi",
protocol: {
udp: {
port: "53",
},
},
});
import pulumi
import pulumi_scm as scm
# TCP Service with multiple destination ports custom timeout
scm_service_tcp_ports = scm.Service("scm_service_tcp_ports",
folder="Shared",
name="scm_service_tcp_ports",
description="Managed by Pulumi",
protocol={
"tcp": {
"port": "80,443",
"override": {
"timeout": 3600,
},
},
})
# TCP Service with source port, destination port and custom timeout values
scm_service_tcp_port_src_dst = scm.Service("scm_service_tcp_port_src_dst",
folder="Shared",
name="scm_service_tcp_port_src_dst",
description="Managed by Pulumi",
protocol={
"tcp": {
"port": "80",
"source_port": "49152-65535",
"override": {
"timeout": 3600,
"halfclose_timeout": 240,
"timewait_timeout": 30,
},
},
})
# UDP Service with single destination port
scm_service_udp_port = scm.Service("scm_service_udp_port",
folder="Shared",
name="scm_service_udp_port",
description="Managed by Pulumi",
protocol={
"udp": {
"port": "53",
},
})
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 {
// TCP Service with multiple destination ports custom timeout
_, err := scm.NewService(ctx, "scm_service_tcp_ports", &scm.ServiceArgs{
Folder: pulumi.String("Shared"),
Name: pulumi.String("scm_service_tcp_ports"),
Description: pulumi.String("Managed by Pulumi"),
Protocol: &scm.ServiceProtocolArgs{
Tcp: &scm.ServiceProtocolTcpArgs{
Port: pulumi.String("80,443"),
Override: &scm.ServiceProtocolTcpOverrideArgs{
Timeout: pulumi.Int(3600),
},
},
},
})
if err != nil {
return err
}
// TCP Service with source port, destination port and custom timeout values
_, err = scm.NewService(ctx, "scm_service_tcp_port_src_dst", &scm.ServiceArgs{
Folder: pulumi.String("Shared"),
Name: pulumi.String("scm_service_tcp_port_src_dst"),
Description: pulumi.String("Managed by Pulumi"),
Protocol: &scm.ServiceProtocolArgs{
Tcp: &scm.ServiceProtocolTcpArgs{
Port: pulumi.String("80"),
SourcePort: pulumi.String("49152-65535"),
Override: &scm.ServiceProtocolTcpOverrideArgs{
Timeout: pulumi.Int(3600),
HalfcloseTimeout: pulumi.Int(240),
TimewaitTimeout: pulumi.Int(30),
},
},
},
})
if err != nil {
return err
}
// UDP Service with single destination port
_, err = scm.NewService(ctx, "scm_service_udp_port", &scm.ServiceArgs{
Folder: pulumi.String("Shared"),
Name: pulumi.String("scm_service_udp_port"),
Description: pulumi.String("Managed by Pulumi"),
Protocol: &scm.ServiceProtocolArgs{
Udp: &scm.ServiceProtocolUdpArgs{
Port: pulumi.String("53"),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Scm = Pulumi.Scm;
return await Deployment.RunAsync(() =>
{
// TCP Service with multiple destination ports custom timeout
var scmServiceTcpPorts = new Scm.Service("scm_service_tcp_ports", new()
{
Folder = "Shared",
Name = "scm_service_tcp_ports",
Description = "Managed by Pulumi",
Protocol = new Scm.Inputs.ServiceProtocolArgs
{
Tcp = new Scm.Inputs.ServiceProtocolTcpArgs
{
Port = "80,443",
Override = new Scm.Inputs.ServiceProtocolTcpOverrideArgs
{
Timeout = 3600,
},
},
},
});
// TCP Service with source port, destination port and custom timeout values
var scmServiceTcpPortSrcDst = new Scm.Service("scm_service_tcp_port_src_dst", new()
{
Folder = "Shared",
Name = "scm_service_tcp_port_src_dst",
Description = "Managed by Pulumi",
Protocol = new Scm.Inputs.ServiceProtocolArgs
{
Tcp = new Scm.Inputs.ServiceProtocolTcpArgs
{
Port = "80",
SourcePort = "49152-65535",
Override = new Scm.Inputs.ServiceProtocolTcpOverrideArgs
{
Timeout = 3600,
HalfcloseTimeout = 240,
TimewaitTimeout = 30,
},
},
},
});
// UDP Service with single destination port
var scmServiceUdpPort = new Scm.Service("scm_service_udp_port", new()
{
Folder = "Shared",
Name = "scm_service_udp_port",
Description = "Managed by Pulumi",
Protocol = new Scm.Inputs.ServiceProtocolArgs
{
Udp = new Scm.Inputs.ServiceProtocolUdpArgs
{
Port = "53",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.scm.Service;
import com.pulumi.scm.ServiceArgs;
import com.pulumi.scm.inputs.ServiceProtocolArgs;
import com.pulumi.scm.inputs.ServiceProtocolTcpArgs;
import com.pulumi.scm.inputs.ServiceProtocolTcpOverrideArgs;
import com.pulumi.scm.inputs.ServiceProtocolUdpArgs;
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) {
// TCP Service with multiple destination ports custom timeout
var scmServiceTcpPorts = new Service("scmServiceTcpPorts", ServiceArgs.builder()
.folder("Shared")
.name("scm_service_tcp_ports")
.description("Managed by Pulumi")
.protocol(ServiceProtocolArgs.builder()
.tcp(ServiceProtocolTcpArgs.builder()
.port("80,443")
.override(ServiceProtocolTcpOverrideArgs.builder()
.timeout(3600)
.build())
.build())
.build())
.build());
// TCP Service with source port, destination port and custom timeout values
var scmServiceTcpPortSrcDst = new Service("scmServiceTcpPortSrcDst", ServiceArgs.builder()
.folder("Shared")
.name("scm_service_tcp_port_src_dst")
.description("Managed by Pulumi")
.protocol(ServiceProtocolArgs.builder()
.tcp(ServiceProtocolTcpArgs.builder()
.port("80")
.sourcePort("49152-65535")
.override(ServiceProtocolTcpOverrideArgs.builder()
.timeout(3600)
.halfcloseTimeout(240)
.timewaitTimeout(30)
.build())
.build())
.build())
.build());
// UDP Service with single destination port
var scmServiceUdpPort = new Service("scmServiceUdpPort", ServiceArgs.builder()
.folder("Shared")
.name("scm_service_udp_port")
.description("Managed by Pulumi")
.protocol(ServiceProtocolArgs.builder()
.udp(ServiceProtocolUdpArgs.builder()
.port("53")
.build())
.build())
.build());
}
}
resources:
# TCP Service with multiple destination ports custom timeout
scmServiceTcpPorts:
type: scm:Service
name: scm_service_tcp_ports
properties:
folder: Shared
name: scm_service_tcp_ports
description: Managed by Pulumi
protocol:
tcp:
port: 80,443
override:
timeout: 3600
# TCP Service with source port, destination port and custom timeout values
scmServiceTcpPortSrcDst:
type: scm:Service
name: scm_service_tcp_port_src_dst
properties:
folder: Shared
name: scm_service_tcp_port_src_dst
description: Managed by Pulumi
protocol:
tcp:
port: '80'
sourcePort: 49152-65535
override:
timeout: 3600
halfcloseTimeout: 240
timewaitTimeout: 30
# UDP Service with single destination port
scmServiceUdpPort:
type: scm:Service
name: scm_service_udp_port
properties:
folder: Shared
name: scm_service_udp_port
description: Managed by Pulumi
protocol:
udp:
port: '53'
Create Service Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Service(name: string, args?: ServiceArgs, opts?: CustomResourceOptions);@overload
def Service(resource_name: str,
args: Optional[ServiceArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def Service(resource_name: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
device: Optional[str] = None,
folder: Optional[str] = None,
name: Optional[str] = None,
protocol: Optional[ServiceProtocolArgs] = None,
snippet: Optional[str] = None,
tags: Optional[Sequence[str]] = None)func NewService(ctx *Context, name string, args *ServiceArgs, opts ...ResourceOption) (*Service, error)public Service(string name, ServiceArgs? args = null, CustomResourceOptions? opts = null)
public Service(String name, ServiceArgs args)
public Service(String name, ServiceArgs args, CustomResourceOptions options)
type: scm:Service
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 ServiceArgs
- 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 ServiceArgs
- 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 ServiceArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ServiceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ServiceArgs
- 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 serviceResource = new Scm.Service("serviceResource", new()
{
Description = "string",
Device = "string",
Folder = "string",
Name = "string",
Protocol = new Scm.Inputs.ServiceProtocolArgs
{
Tcp = new Scm.Inputs.ServiceProtocolTcpArgs
{
Port = "string",
Override = new Scm.Inputs.ServiceProtocolTcpOverrideArgs
{
HalfcloseTimeout = 0,
Timeout = 0,
TimewaitTimeout = 0,
},
SourcePort = "string",
},
Udp = new Scm.Inputs.ServiceProtocolUdpArgs
{
Port = "string",
Override = new Scm.Inputs.ServiceProtocolUdpOverrideArgs
{
Timeout = 0,
},
SourcePort = "string",
},
},
Snippet = "string",
Tags = new[]
{
"string",
},
});
example, err := scm.NewService(ctx, "serviceResource", &scm.ServiceArgs{
Description: pulumi.String("string"),
Device: pulumi.String("string"),
Folder: pulumi.String("string"),
Name: pulumi.String("string"),
Protocol: &scm.ServiceProtocolArgs{
Tcp: &scm.ServiceProtocolTcpArgs{
Port: pulumi.String("string"),
Override: &scm.ServiceProtocolTcpOverrideArgs{
HalfcloseTimeout: pulumi.Int(0),
Timeout: pulumi.Int(0),
TimewaitTimeout: pulumi.Int(0),
},
SourcePort: pulumi.String("string"),
},
Udp: &scm.ServiceProtocolUdpArgs{
Port: pulumi.String("string"),
Override: &scm.ServiceProtocolUdpOverrideArgs{
Timeout: pulumi.Int(0),
},
SourcePort: pulumi.String("string"),
},
},
Snippet: pulumi.String("string"),
Tags: pulumi.StringArray{
pulumi.String("string"),
},
})
var serviceResource = new Service("serviceResource", ServiceArgs.builder()
.description("string")
.device("string")
.folder("string")
.name("string")
.protocol(ServiceProtocolArgs.builder()
.tcp(ServiceProtocolTcpArgs.builder()
.port("string")
.override(ServiceProtocolTcpOverrideArgs.builder()
.halfcloseTimeout(0)
.timeout(0)
.timewaitTimeout(0)
.build())
.sourcePort("string")
.build())
.udp(ServiceProtocolUdpArgs.builder()
.port("string")
.override(ServiceProtocolUdpOverrideArgs.builder()
.timeout(0)
.build())
.sourcePort("string")
.build())
.build())
.snippet("string")
.tags("string")
.build());
service_resource = scm.Service("serviceResource",
description="string",
device="string",
folder="string",
name="string",
protocol={
"tcp": {
"port": "string",
"override": {
"halfclose_timeout": 0,
"timeout": 0,
"timewait_timeout": 0,
},
"source_port": "string",
},
"udp": {
"port": "string",
"override": {
"timeout": 0,
},
"source_port": "string",
},
},
snippet="string",
tags=["string"])
const serviceResource = new scm.Service("serviceResource", {
description: "string",
device: "string",
folder: "string",
name: "string",
protocol: {
tcp: {
port: "string",
override: {
halfcloseTimeout: 0,
timeout: 0,
timewaitTimeout: 0,
},
sourcePort: "string",
},
udp: {
port: "string",
override: {
timeout: 0,
},
sourcePort: "string",
},
},
snippet: "string",
tags: ["string"],
});
type: scm:Service
properties:
description: string
device: string
folder: string
name: string
protocol:
tcp:
override:
halfcloseTimeout: 0
timeout: 0
timewaitTimeout: 0
port: string
sourcePort: string
udp:
override:
timeout: 0
port: string
sourcePort: string
snippet: string
tags:
- string
Service 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 Service resource accepts the following input properties:
- Description string
- Description
- Device string
- The device in which the resource is defined
- Folder string
- The folder in which the resource is defined
- Name string
- The name of the service
- Protocol
Service
Protocol - Protocol
- Snippet string
- The snippet in which the resource is defined
- List<string>
- Tags for service object
- Description string
- Description
- Device string
- The device in which the resource is defined
- Folder string
- The folder in which the resource is defined
- Name string
- The name of the service
- Protocol
Service
Protocol Args - Protocol
- Snippet string
- The snippet in which the resource is defined
- []string
- Tags for service object
- description String
- Description
- device String
- The device in which the resource is defined
- folder String
- The folder in which the resource is defined
- name String
- The name of the service
- protocol
Service
Protocol - Protocol
- snippet String
- The snippet in which the resource is defined
- List<String>
- Tags for service object
- description string
- Description
- device string
- The device in which the resource is defined
- folder string
- The folder in which the resource is defined
- name string
- The name of the service
- protocol
Service
Protocol - Protocol
- snippet string
- The snippet in which the resource is defined
- string[]
- Tags for service object
- description str
- Description
- device str
- The device in which the resource is defined
- folder str
- The folder in which the resource is defined
- name str
- The name of the service
- protocol
Service
Protocol Args - Protocol
- snippet str
- The snippet in which the resource is defined
- Sequence[str]
- Tags for service object
- description String
- Description
- device String
- The device in which the resource is defined
- folder String
- The folder in which the resource is defined
- name String
- The name of the service
- protocol Property Map
- Protocol
- snippet String
- The snippet in which the resource is defined
- List<String>
- Tags for service object
Outputs
All input properties are implicitly available as output properties. Additionally, the Service resource produces the following output properties:
Look up Existing Service Resource
Get an existing Service 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?: ServiceState, opts?: CustomResourceOptions): Service@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
device: Optional[str] = None,
folder: Optional[str] = None,
name: Optional[str] = None,
protocol: Optional[ServiceProtocolArgs] = None,
snippet: Optional[str] = None,
tags: Optional[Sequence[str]] = None,
tfid: Optional[str] = None) -> Servicefunc GetService(ctx *Context, name string, id IDInput, state *ServiceState, opts ...ResourceOption) (*Service, error)public static Service Get(string name, Input<string> id, ServiceState? state, CustomResourceOptions? opts = null)public static Service get(String name, Output<String> id, ServiceState state, CustomResourceOptions options)resources: _: type: scm:Service 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.
- Description string
- Description
- Device string
- The device in which the resource is defined
- Folder string
- The folder in which the resource is defined
- Name string
- The name of the service
- Protocol
Service
Protocol - Protocol
- Snippet string
- The snippet in which the resource is defined
- List<string>
- Tags for service object
- Tfid string
- Description string
- Description
- Device string
- The device in which the resource is defined
- Folder string
- The folder in which the resource is defined
- Name string
- The name of the service
- Protocol
Service
Protocol Args - Protocol
- Snippet string
- The snippet in which the resource is defined
- []string
- Tags for service object
- Tfid string
- description String
- Description
- device String
- The device in which the resource is defined
- folder String
- The folder in which the resource is defined
- name String
- The name of the service
- protocol
Service
Protocol - Protocol
- snippet String
- The snippet in which the resource is defined
- List<String>
- Tags for service object
- tfid String
- description string
- Description
- device string
- The device in which the resource is defined
- folder string
- The folder in which the resource is defined
- name string
- The name of the service
- protocol
Service
Protocol - Protocol
- snippet string
- The snippet in which the resource is defined
- string[]
- Tags for service object
- tfid string
- description str
- Description
- device str
- The device in which the resource is defined
- folder str
- The folder in which the resource is defined
- name str
- The name of the service
- protocol
Service
Protocol Args - Protocol
- snippet str
- The snippet in which the resource is defined
- Sequence[str]
- Tags for service object
- tfid str
- description String
- Description
- device String
- The device in which the resource is defined
- folder String
- The folder in which the resource is defined
- name String
- The name of the service
- protocol Property Map
- Protocol
- snippet String
- The snippet in which the resource is defined
- List<String>
- Tags for service object
- tfid String
Supporting Types
ServiceProtocol, ServiceProtocolArgs
- tcp Property Map
- Tcp
- udp Property Map
- Udp
ServiceProtocolTcp, ServiceProtocolTcpArgs
- Port string
- Port
- Override
Service
Protocol Tcp Override - Override
- Source
Port string - Source port
- Port string
- Port
- Override
Service
Protocol Tcp Override - Override
- Source
Port string - Source port
- port String
- Port
- override
Service
Protocol Tcp Override - Override
- source
Port String - Source port
- port string
- Port
- override
Service
Protocol Tcp Override - Override
- source
Port string - Source port
- port str
- Port
- override
Service
Protocol Tcp Override - Override
- source_
port str - Source port
- port String
- Port
- override Property Map
- Override
- source
Port String - Source port
ServiceProtocolTcpOverride, ServiceProtocolTcpOverrideArgs
- Halfclose
Timeout int - tcp session half-close timeout value (in second)
- Timeout int
- tcp session timeout value (in second)
- Timewait
Timeout int - tcp session time-wait timeout value (in second)
- Halfclose
Timeout int - tcp session half-close timeout value (in second)
- Timeout int
- tcp session timeout value (in second)
- Timewait
Timeout int - tcp session time-wait timeout value (in second)
- halfclose
Timeout Integer - tcp session half-close timeout value (in second)
- timeout Integer
- tcp session timeout value (in second)
- timewait
Timeout Integer - tcp session time-wait timeout value (in second)
- halfclose
Timeout number - tcp session half-close timeout value (in second)
- timeout number
- tcp session timeout value (in second)
- timewait
Timeout number - tcp session time-wait timeout value (in second)
- halfclose_
timeout int - tcp session half-close timeout value (in second)
- timeout int
- tcp session timeout value (in second)
- timewait_
timeout int - tcp session time-wait timeout value (in second)
- halfclose
Timeout Number - tcp session half-close timeout value (in second)
- timeout Number
- tcp session timeout value (in second)
- timewait
Timeout Number - tcp session time-wait timeout value (in second)
ServiceProtocolUdp, ServiceProtocolUdpArgs
- Port string
- Port
- Override
Service
Protocol Udp Override - Override
- Source
Port string - Source port
- Port string
- Port
- Override
Service
Protocol Udp Override - Override
- Source
Port string - Source port
- port String
- Port
- override
Service
Protocol Udp Override - Override
- source
Port String - Source port
- port string
- Port
- override
Service
Protocol Udp Override - Override
- source
Port string - Source port
- port str
- Port
- override
Service
Protocol Udp Override - Override
- source_
port str - Source port
- port String
- Port
- override Property Map
- Override
- source
Port String - Source port
ServiceProtocolUdpOverride, ServiceProtocolUdpOverrideArgs
- Timeout int
- udp session timeout value (in second)
- Timeout int
- udp session timeout value (in second)
- timeout Integer
- udp session timeout value (in second)
- timeout number
- udp session timeout value (in second)
- timeout int
- udp session timeout value (in second)
- timeout Number
- udp session timeout value (in second)
Package Details
- Repository
- scm pulumi/pulumi-scm
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
scmTerraform Provider.
