gcore 0.22.0 published on Wednesday, Apr 30, 2025 by g-core
gcore.getRouter
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcore from "@pulumi/gcore";
const pr = gcore.getProject({
name: "test",
});
const rg = gcore.getRegion({
name: "ED-10 Preprod",
});
const tr = Promise.all([rg, pr]).then(([rg, pr]) => gcore.getRouter({
name: "test_router",
regionId: rg.id,
projectId: pr.id,
}));
export const view = tr;
import pulumi
import pulumi_gcore as gcore
pr = gcore.get_project(name="test")
rg = gcore.get_region(name="ED-10 Preprod")
tr = gcore.get_router(name="test_router",
region_id=rg.id,
project_id=pr.id)
pulumi.export("view", tr)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/gcore/gcore"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
pr, err := gcore.GetProject(ctx, &gcore.GetProjectArgs{
Name: "test",
}, nil)
if err != nil {
return err
}
rg, err := gcore.GetRegion(ctx, &gcore.GetRegionArgs{
Name: "ED-10 Preprod",
}, nil)
if err != nil {
return err
}
tr, err := gcore.LookupRouter(ctx, &gcore.LookupRouterArgs{
Name: "test_router",
RegionId: pulumi.Float64Ref(rg.Id),
ProjectId: pulumi.Float64Ref(pr.Id),
}, nil)
if err != nil {
return err
}
ctx.Export("view", tr)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcore = Pulumi.Gcore;
return await Deployment.RunAsync(() =>
{
var pr = Gcore.GetProject.Invoke(new()
{
Name = "test",
});
var rg = Gcore.GetRegion.Invoke(new()
{
Name = "ED-10 Preprod",
});
var tr = Gcore.GetRouter.Invoke(new()
{
Name = "test_router",
RegionId = rg.Apply(getRegionResult => getRegionResult.Id),
ProjectId = pr.Apply(getProjectResult => getProjectResult.Id),
});
return new Dictionary<string, object?>
{
["view"] = tr,
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcore.GcoreFunctions;
import com.pulumi.gcore.inputs.GetProjectArgs;
import com.pulumi.gcore.inputs.GetRegionArgs;
import com.pulumi.gcore.inputs.GetRouterArgs;
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 pr = GcoreFunctions.getProject(GetProjectArgs.builder()
.name("test")
.build());
final var rg = GcoreFunctions.getRegion(GetRegionArgs.builder()
.name("ED-10 Preprod")
.build());
final var tr = GcoreFunctions.getRouter(GetRouterArgs.builder()
.name("test_router")
.regionId(rg.applyValue(getRegionResult -> getRegionResult.id()))
.projectId(pr.applyValue(getProjectResult -> getProjectResult.id()))
.build());
ctx.export("view", tr.applyValue(getRouterResult -> getRouterResult));
}
}
variables:
pr:
fn::invoke:
function: gcore:getProject
arguments:
name: test
rg:
fn::invoke:
function: gcore:getRegion
arguments:
name: ED-10 Preprod
tr:
fn::invoke:
function: gcore:getRouter
arguments:
name: test_router
regionId: ${rg.id}
projectId: ${pr.id}
outputs:
view: ${tr}
Using getRouter
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 getRouter(args: GetRouterArgs, opts?: InvokeOptions): Promise<GetRouterResult>
function getRouterOutput(args: GetRouterOutputArgs, opts?: InvokeOptions): Output<GetRouterResult>
def get_router(id: Optional[str] = None,
name: Optional[str] = None,
project_id: Optional[float] = None,
project_name: Optional[str] = None,
region_id: Optional[float] = None,
region_name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetRouterResult
def get_router_output(id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
project_id: Optional[pulumi.Input[float]] = None,
project_name: Optional[pulumi.Input[str]] = None,
region_id: Optional[pulumi.Input[float]] = None,
region_name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetRouterResult]
func LookupRouter(ctx *Context, args *LookupRouterArgs, opts ...InvokeOption) (*LookupRouterResult, error)
func LookupRouterOutput(ctx *Context, args *LookupRouterOutputArgs, opts ...InvokeOption) LookupRouterResultOutput
> Note: This function is named LookupRouter
in the Go SDK.
public static class GetRouter
{
public static Task<GetRouterResult> InvokeAsync(GetRouterArgs args, InvokeOptions? opts = null)
public static Output<GetRouterResult> Invoke(GetRouterInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetRouterResult> getRouter(GetRouterArgs args, InvokeOptions options)
public static Output<GetRouterResult> getRouter(GetRouterArgs args, InvokeOptions options)
fn::invoke:
function: gcore:index/getRouter:getRouter
arguments:
# arguments dictionary
The following arguments are supported:
- Name string
- Id string
- The ID of this resource.
- Project
Id double - Project
Name string - Region
Id double - Region
Name string
- Name string
- Id string
- The ID of this resource.
- Project
Id float64 - Project
Name string - Region
Id float64 - Region
Name string
- name String
- id String
- The ID of this resource.
- project
Id Double - project
Name String - region
Id Double - region
Name String
- name string
- id string
- The ID of this resource.
- project
Id number - project
Name string - region
Id number - region
Name string
- name str
- id str
- The ID of this resource.
- project_
id float - project_
name str - region_
id float - region_
name str
- name String
- id String
- The ID of this resource.
- project
Id Number - project
Name String - region
Id Number - region
Name String
getRouter Result
The following output properties are available:
- External
Gateway List<GetInfos Router External Gateway Info> - Id string
- The ID of this resource.
- Interfaces
List<Get
Router Interface> - Name string
- Routes
List<Get
Router Route> - Status string
- Project
Id double - Project
Name string - Region
Id double - Region
Name string
- External
Gateway []GetInfos Router External Gateway Info - Id string
- The ID of this resource.
- Interfaces
[]Get
Router Interface - Name string
- Routes
[]Get
Router Route - Status string
- Project
Id float64 - Project
Name string - Region
Id float64 - Region
Name string
- external
Gateway List<GetInfos Router External Gateway Info> - id String
- The ID of this resource.
- interfaces
List<Get
Router Interface> - name String
- routes
List<Get
Router Route> - status String
- project
Id Double - project
Name String - region
Id Double - region
Name String
- external
Gateway GetInfos Router External Gateway Info[] - id string
- The ID of this resource.
- interfaces
Get
Router Interface[] - name string
- routes
Get
Router Route[] - status string
- project
Id number - project
Name string - region
Id number - region
Name string
- external_
gateway_ Sequence[Getinfos Router External Gateway Info] - id str
- The ID of this resource.
- interfaces
Sequence[Get
Router Interface] - name str
- routes
Sequence[Get
Router Route] - status str
- project_
id float - project_
name str - region_
id float - region_
name str
- external
Gateway List<Property Map>Infos - id String
- The ID of this resource.
- interfaces List<Property Map>
- name String
- routes List<Property Map>
- status String
- project
Id Number - project
Name String - region
Id Number - region
Name String
Supporting Types
GetRouterExternalGatewayInfo
- enable
Snat Boolean - external
Fixed List<Property Map>Ips - network
Id String
GetRouterExternalGatewayInfoExternalFixedIp
- ip_
address str - subnet_
id str
GetRouterInterface
- ip_
address str - mac_
address str - network_
id str - port_
id str - subnet_
id str - type str
GetRouterRoute
- Destination string
- Nexthop string
- Destination string
- Nexthop string
- destination String
- nexthop String
- destination string
- nexthop string
- destination str
- nexthop str
- destination String
- nexthop String
Package Details
- Repository
- gcore g-core/terraform-provider-gcore
- License
- Notes
- This Pulumi package is based on the
gcore
Terraform Provider.