published on Saturday, Jul 11, 2026 by Pulumi
published on Saturday, Jul 11, 2026 by Pulumi
The Service resource allows you to manage Tailscale Services in your Tailscale network. Services let you publish internal resources (like databases or web servers) as named resources in your tailnet. Services provide a stable MagicDNS name, a Tailscale virtual IP address pair, can be served by multiple nodes, and are valid access control destinations. See https://tailscale.com/docs/features/tailscale-services) for more information.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as tailscale from "@pulumi/tailscale";
const example = new tailscale.Service("example", {
name: "svc:my-service",
comment: "My service",
ports: ["tcp:443"],
tags: ["tag:web"],
});
import pulumi
import pulumi_tailscale as tailscale
example = tailscale.Service("example",
name="svc:my-service",
comment="My service",
ports=["tcp:443"],
tags=["tag:web"])
package main
import (
"github.com/pulumi/pulumi-tailscale/sdk/go/tailscale"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := tailscale.NewService(ctx, "example", &tailscale.ServiceArgs{
Name: pulumi.String("svc:my-service"),
Comment: pulumi.String("My service"),
Ports: pulumi.StringArray{
pulumi.String("tcp:443"),
},
Tags: pulumi.StringArray{
pulumi.String("tag:web"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tailscale = Pulumi.Tailscale;
return await Deployment.RunAsync(() =>
{
var example = new Tailscale.Service("example", new()
{
Name = "svc:my-service",
Comment = "My service",
Ports = new[]
{
"tcp:443",
},
Tags = new[]
{
"tag:web",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tailscale.Service;
import com.pulumi.tailscale.ServiceArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 Service("example", ServiceArgs.builder()
.name("svc:my-service")
.comment("My service")
.ports("tcp:443")
.tags("tag:web")
.build());
}
}
resources:
example:
type: tailscale:Service
properties:
name: svc:my-service
comment: My service
ports:
- tcp:443
tags:
- tag:web
pulumi {
required_providers {
tailscale = {
source = "pulumi/tailscale"
}
}
}
resource "tailscale_service" "example" {
name = "svc:my-service"
comment = "My service"
ports = ["tcp:443"]
tags = ["tag:web"]
}
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: ServiceArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Service(resource_name: str,
opts: Optional[ResourceOptions] = None,
ports: Optional[Sequence[str]] = None,
comment: Optional[str] = None,
name: 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, CustomResourceOptions? opts = null)
public Service(String name, ServiceArgs args)
public Service(String name, ServiceArgs args, CustomResourceOptions options)
type: tailscale:Service
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "tailscale_service" "name" {
# resource properties
}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 Tailscale.Service("serviceResource", new()
{
Ports = new[]
{
"string",
},
Comment = "string",
Name = "string",
Tags = new[]
{
"string",
},
});
example, err := tailscale.NewService(ctx, "serviceResource", &tailscale.ServiceArgs{
Ports: pulumi.StringArray{
pulumi.String("string"),
},
Comment: pulumi.String("string"),
Name: pulumi.String("string"),
Tags: pulumi.StringArray{
pulumi.String("string"),
},
})
resource "tailscale_service" "serviceResource" {
lifecycle {
create_before_destroy = true
}
ports = ["string"]
comment = "string"
name = "string"
tags = ["string"]
}
var serviceResource = new Service("serviceResource", ServiceArgs.builder()
.ports("string")
.comment("string")
.name("string")
.tags("string")
.build());
service_resource = tailscale.Service("serviceResource",
ports=["string"],
comment="string",
name="string",
tags=["string"])
const serviceResource = new tailscale.Service("serviceResource", {
ports: ["string"],
comment: "string",
name: "string",
tags: ["string"],
});
type: tailscale:Service
properties:
comment: string
name: string
ports:
- 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:
- Ports List<string>
- A list of protocol:port pairs to be exposed by the Service. The only supported protocol is "tcp" at this time. "do-not-validate" can be used to skip validation.
- Comment string
- An optional comment describing the Service.
- Name string
- The name of the Service. Must begin with
svc:. - List<string>
- The ACL tags applied to the Service.
- Ports []string
- A list of protocol:port pairs to be exposed by the Service. The only supported protocol is "tcp" at this time. "do-not-validate" can be used to skip validation.
- Comment string
- An optional comment describing the Service.
- Name string
- The name of the Service. Must begin with
svc:. - []string
- The ACL tags applied to the Service.
- ports list(string)
- A list of protocol:port pairs to be exposed by the Service. The only supported protocol is "tcp" at this time. "do-not-validate" can be used to skip validation.
- comment string
- An optional comment describing the Service.
- name string
- The name of the Service. Must begin with
svc:. - list(string)
- The ACL tags applied to the Service.
- ports List<String>
- A list of protocol:port pairs to be exposed by the Service. The only supported protocol is "tcp" at this time. "do-not-validate" can be used to skip validation.
- comment String
- An optional comment describing the Service.
- name String
- The name of the Service. Must begin with
svc:. - List<String>
- The ACL tags applied to the Service.
- ports string[]
- A list of protocol:port pairs to be exposed by the Service. The only supported protocol is "tcp" at this time. "do-not-validate" can be used to skip validation.
- comment string
- An optional comment describing the Service.
- name string
- The name of the Service. Must begin with
svc:. - string[]
- The ACL tags applied to the Service.
- ports Sequence[str]
- A list of protocol:port pairs to be exposed by the Service. The only supported protocol is "tcp" at this time. "do-not-validate" can be used to skip validation.
- comment str
- An optional comment describing the Service.
- name str
- The name of the Service. Must begin with
svc:. - Sequence[str]
- The ACL tags applied to the Service.
- ports List<String>
- A list of protocol:port pairs to be exposed by the Service. The only supported protocol is "tcp" at this time. "do-not-validate" can be used to skip validation.
- comment String
- An optional comment describing the Service.
- name String
- The name of the Service. Must begin with
svc:. - List<String>
- The ACL tags applied to the Service.
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,
addrs: Optional[Sequence[str]] = None,
comment: Optional[str] = None,
name: Optional[str] = None,
ports: Optional[Sequence[str]] = None,
tags: Optional[Sequence[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: tailscale:Service get: id: ${id}import {
to = tailscale_service.example
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.
- Addrs List<string>
- The IP addresses assigned to the Service.
- Comment string
- An optional comment describing the Service.
- Name string
- The name of the Service. Must begin with
svc:. - Ports List<string>
- A list of protocol:port pairs to be exposed by the Service. The only supported protocol is "tcp" at this time. "do-not-validate" can be used to skip validation.
- List<string>
- The ACL tags applied to the Service.
- Addrs []string
- The IP addresses assigned to the Service.
- Comment string
- An optional comment describing the Service.
- Name string
- The name of the Service. Must begin with
svc:. - Ports []string
- A list of protocol:port pairs to be exposed by the Service. The only supported protocol is "tcp" at this time. "do-not-validate" can be used to skip validation.
- []string
- The ACL tags applied to the Service.
- addrs list(string)
- The IP addresses assigned to the Service.
- comment string
- An optional comment describing the Service.
- name string
- The name of the Service. Must begin with
svc:. - ports list(string)
- A list of protocol:port pairs to be exposed by the Service. The only supported protocol is "tcp" at this time. "do-not-validate" can be used to skip validation.
- list(string)
- The ACL tags applied to the Service.
- addrs List<String>
- The IP addresses assigned to the Service.
- comment String
- An optional comment describing the Service.
- name String
- The name of the Service. Must begin with
svc:. - ports List<String>
- A list of protocol:port pairs to be exposed by the Service. The only supported protocol is "tcp" at this time. "do-not-validate" can be used to skip validation.
- List<String>
- The ACL tags applied to the Service.
- addrs string[]
- The IP addresses assigned to the Service.
- comment string
- An optional comment describing the Service.
- name string
- The name of the Service. Must begin with
svc:. - ports string[]
- A list of protocol:port pairs to be exposed by the Service. The only supported protocol is "tcp" at this time. "do-not-validate" can be used to skip validation.
- string[]
- The ACL tags applied to the Service.
- addrs Sequence[str]
- The IP addresses assigned to the Service.
- comment str
- An optional comment describing the Service.
- name str
- The name of the Service. Must begin with
svc:. - ports Sequence[str]
- A list of protocol:port pairs to be exposed by the Service. The only supported protocol is "tcp" at this time. "do-not-validate" can be used to skip validation.
- Sequence[str]
- The ACL tags applied to the Service.
- addrs List<String>
- The IP addresses assigned to the Service.
- comment String
- An optional comment describing the Service.
- name String
- The name of the Service. Must begin with
svc:. - ports List<String>
- A list of protocol:port pairs to be exposed by the Service. The only supported protocol is "tcp" at this time. "do-not-validate" can be used to skip validation.
- List<String>
- The ACL tags applied to the Service.
Package Details
- Repository
- tailscale pulumi/pulumi-tailscale
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
tailscaleTerraform Provider.
published on Saturday, Jul 11, 2026 by Pulumi