import * as pulumi from "@pulumi/pulumi"; /** * The deviceSubnetRoutes resource allows you to configure enabled subnet routes for your Tailscale devices. See https://tailscale.com/kb/1019/subnets for more information. * * Routes must be both advertised and enabled for a device to act as a subnet router or exit node. Routes must be advertised directly from the device: advertised routes cannot be managed through Terraform. If a device is advertising routes, they are not exposed to traffic until they are enabled. Conversely, if routes are enabled before they are advertised, they are not available for routing until the device in question is advertising them. * * Note: all routes enabled for the device through the admin console or autoApprovers in the ACL must be explicitly added to the routes attribute of this resource to avoid configuration drift. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as tailscale from "@pulumi/tailscale"; * * const sampleDevice = tailscale.getDevice({ * name: "device.example.com", * }); * const sampleRoutes = new tailscale.DeviceSubnetRoutes("sample_routes", { * deviceId: sampleDevice.then(sampleDevice => sampleDevice.nodeId), * routes: [ * "10.0.1.0/24", * "1.2.0.0/16", * "2.0.0.0/24", * ], * }); * const sampleExitNode = new tailscale.DeviceSubnetRoutes("sample_exit_node", { * deviceId: sampleDevice.then(sampleDevice => sampleDevice.nodeId), * routes: [ * "0.0.0.0/0", * "::/0", * ], * }); * ``` * * ## Import * * The `pulumi import` command can be used, for example: * * Device subnet rules can be imported using the node ID (preferred), e.g., * * ```sh * $ pulumi import tailscale:index/deviceSubnetRoutes:DeviceSubnetRoutes sample nodeidCNTRL * ``` * * Device subnet rules can be imported using the legacy ID, e.g., * * ```sh * $ pulumi import tailscale:index/deviceSubnetRoutes:DeviceSubnetRoutes sample 123456789 * ``` */ export declare class DeviceSubnetRoutes extends pulumi.CustomResource { /** * Get an existing DeviceSubnetRoutes resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: DeviceSubnetRoutesState, opts?: pulumi.CustomResourceOptions): DeviceSubnetRoutes; /** * Returns true if the given object is an instance of DeviceSubnetRoutes. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is DeviceSubnetRoutes; /** * The device to set subnet routes for */ readonly deviceId: pulumi.Output; /** * The subnet routes that are enabled to be routed by a device */ readonly routes: pulumi.Output; /** * Create a DeviceSubnetRoutes resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: DeviceSubnetRoutesArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering DeviceSubnetRoutes resources. */ export interface DeviceSubnetRoutesState { /** * The device to set subnet routes for */ deviceId?: pulumi.Input; /** * The subnet routes that are enabled to be routed by a device */ routes?: pulumi.Input[]>; } /** * The set of arguments for constructing a DeviceSubnetRoutes resource. */ export interface DeviceSubnetRoutesArgs { /** * The device to set subnet routes for */ deviceId: pulumi.Input; /** * The subnet routes that are enabled to be routed by a device */ routes: pulumi.Input[]>; }