routeros 1.83.1 published on Monday, Apr 28, 2025 by terraform-routeros
routeros.getIpServices
Explore with Pulumi AI
routeros 1.83.1 published on Monday, Apr 28, 2025 by terraform-routeros
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as routeros from "@pulumi/routeros";
export = async () => {
const router = await routeros.getIpServices({});
const router_disabled: routeros.IpService[] = [];
for (const range of Object.entries(.filter(s => s.name != "www-ssl").reduce((__obj, s) => ({ ...__obj, [s.name]: s }))).map(([k, v]) => ({key: k, value: v}))) {
router_disabled.push(new routeros.IpService(`router-disabled-${range.key}`, {
disabled: true,
numbers: range.value.name,
port: range.value.port,
}, {
provider: routeros.router,
}));
}
}
import pulumi
import pulumi_routeros as routeros
router = routeros.get_ip_services()
router_disabled = []
for range in [{"key": k, "value": v} for [k, v] in enumerate({s.name: s for s in router.services if s.name != www-ssl})]:
router_disabled.append(routeros.IpService(f"router-disabled-{range['key']}",
disabled=True,
numbers=range["value"],
port=range["value"],
opts = pulumi.ResourceOptions(provider=routeros["router"])))
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/routeros/routeros"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
router, err := routeros.GetIpServices(ctx, &routeros.GetIpServicesArgs{}, nil)
if err != nil {
return err
}
var router_disabled []*routeros.IpService
for key0, val0 := range map[string]routeros.GetIpServicesService("TODO: For expression") {
__res, err := routeros.NewIpService(ctx, fmt.Sprintf("router-disabled-%v", key0), &routeros.IpServiceArgs{
Disabled: pulumi.Bool(true),
Numbers: pulumi.String(val0),
Port: pulumi.Float64(val0),
}, pulumi.Provider(routeros.Router))
if err != nil {
return err
}
router_disabled = append(router_disabled, __res)
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Pulumi;
using Routeros = Pulumi.Routeros;
return await Deployment.RunAsync(async() =>
{
var router = await Routeros.GetIpServices.InvokeAsync();
var router_disabled = new List<Routeros.IpService>();
foreach (var range in .Select(pair => new { pair.Key, pair.Value }))
{
router_disabled.Add(new Routeros.IpService($"router-disabled-{range.Key}", new()
{
Disabled = true,
Numbers = range.Value.Name,
Port = range.Value.Port,
}, new CustomResourceOptions
{
Provider = routeros.Router,
}));
}
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.routeros.RouterosFunctions;
import com.pulumi.routeros.inputs.GetIpServicesArgs;
import com.pulumi.routeros.IpService;
import com.pulumi.routeros.IpServiceArgs;
import com.pulumi.codegen.internal.KeyedValue;
import com.pulumi.resources.CustomResourceOptions;
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) {
final var router = RouterosFunctions.getIpServices();
for (var range : KeyedValue.of("TODO: ForExpression")) {
new IpService("router-disabled-" + range.key(), IpServiceArgs.builder()
.disabled(true)
.numbers(range.value().name())
.port(range.value().port())
.build(), CustomResourceOptions.builder()
.provider(routeros.router())
.build());
}
}
}
resources:
router-disabled:
type: routeros:IpService
properties:
disabled: true
numbers: ${range.value.name}
port: ${range.value.port}
options:
provider: ${routeros.router}
variables:
router:
fn::invoke:
function: routeros:getIpServices
arguments: {}
Using getIpServices
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getIpServices(args: GetIpServicesArgs, opts?: InvokeOptions): Promise<GetIpServicesResult>
function getIpServicesOutput(args: GetIpServicesOutputArgs, opts?: InvokeOptions): Output<GetIpServicesResult>
def get_ip_services(___id_: Optional[float] = None,
___path_: Optional[str] = None,
filter: Optional[Mapping[str, str]] = None,
id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetIpServicesResult
def get_ip_services_output(___id_: Optional[pulumi.Input[float]] = None,
___path_: Optional[pulumi.Input[str]] = None,
filter: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetIpServicesResult]
func GetIpServices(ctx *Context, args *GetIpServicesArgs, opts ...InvokeOption) (*GetIpServicesResult, error)
func GetIpServicesOutput(ctx *Context, args *GetIpServicesOutputArgs, opts ...InvokeOption) GetIpServicesResultOutput
> Note: This function is named GetIpServices
in the Go SDK.
public static class GetIpServices
{
public static Task<GetIpServicesResult> InvokeAsync(GetIpServicesArgs args, InvokeOptions? opts = null)
public static Output<GetIpServicesResult> Invoke(GetIpServicesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetIpServicesResult> getIpServices(GetIpServicesArgs args, InvokeOptions options)
public static Output<GetIpServicesResult> getIpServices(GetIpServicesArgs args, InvokeOptions options)
fn::invoke:
function: routeros:index/getIpServices:getIpServices
arguments:
# arguments dictionary
The following arguments are supported:
getIpServices Result
The following output properties are available:
Supporting Types
GetIpServicesService
- Address string
- Certificate string
- Disabled bool
- Id string
- Invalid string
- Name string
- Port double
- Tls
Version string - Vrf string
- Address string
- Certificate string
- Disabled bool
- Id string
- Invalid string
- Name string
- Port float64
- Tls
Version string - Vrf string
- address String
- certificate String
- disabled Boolean
- id String
- invalid String
- name String
- port Double
- tls
Version String - vrf String
- address string
- certificate string
- disabled boolean
- id string
- invalid string
- name string
- port number
- tls
Version string - vrf string
- address str
- certificate str
- disabled bool
- id str
- invalid str
- name str
- port float
- tls_
version str - vrf str
- address String
- certificate String
- disabled Boolean
- id String
- invalid String
- name String
- port Number
- tls
Version String - vrf String
Package Details
- Repository
- routeros terraform-routeros/terraform-provider-routeros
- License
- Notes
- This Pulumi package is based on the
routeros
Terraform Provider.
routeros 1.83.1 published on Monday, Apr 28, 2025 by terraform-routeros