gcore.Router
Explore with Pulumi AI
Represent router. Router enables you to dynamically exchange routes between networks
Example Usage
Coming soon!
Coming soon!
Coming soon!
Coming soon!
Coming soon!
resources:
router:
type: gcore:Router
properties:
dynamic:
- iterator: ${egi}
forEach: ${var.external_gateway_info}
content:
- type: ${egi.value.type}
enableSnat: ${egi.value.enable_snat}
networkId: ${egi.value.network_id}
- iterator: ${ifaces}
forEach: ${var.interfaces}
content:
- type: ${ifaces.value.type}
subnetId: ${ifaces.value.subnet_id}
- iterator: ${rs}
forEach: ${var.routes}
content:
- destination: ${rs.value.destination}
nexthop: ${rs.value.nexthop}
regionId: 1
projectId: 1
Create Router Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Router(name: string, args?: RouterArgs, opts?: CustomResourceOptions);
@overload
def Router(resource_name: str,
args: Optional[RouterArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def Router(resource_name: str,
opts: Optional[ResourceOptions] = None,
external_gateway_info: Optional[RouterExternalGatewayInfoArgs] = None,
interfaces: Optional[Sequence[RouterInterfaceArgs]] = 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,
router_id: Optional[str] = None,
routes: Optional[Sequence[RouterRouteArgs]] = None)
func NewRouter(ctx *Context, name string, args *RouterArgs, opts ...ResourceOption) (*Router, error)
public Router(string name, RouterArgs? args = null, CustomResourceOptions? opts = null)
public Router(String name, RouterArgs args)
public Router(String name, RouterArgs args, CustomResourceOptions options)
type: gcore:Router
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 RouterArgs
- 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 RouterArgs
- 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 RouterArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RouterArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RouterArgs
- 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 routerResource = new Gcore.Router("routerResource", new()
{
ExternalGatewayInfo = new Gcore.Inputs.RouterExternalGatewayInfoArgs
{
EnableSnat = false,
ExternalFixedIps = new[]
{
new Gcore.Inputs.RouterExternalGatewayInfoExternalFixedIpArgs
{
IpAddress = "string",
SubnetId = "string",
},
},
NetworkId = "string",
Type = "string",
},
Interfaces = new[]
{
new Gcore.Inputs.RouterInterfaceArgs
{
SubnetId = "string",
Type = "string",
IpAddress = "string",
MacAddress = "string",
NetworkId = "string",
PortId = "string",
},
},
Name = "string",
ProjectId = 0,
ProjectName = "string",
RegionId = 0,
RegionName = "string",
RouterId = "string",
Routes = new[]
{
new Gcore.Inputs.RouterRouteArgs
{
Destination = "string",
Nexthop = "string",
},
},
});
example, err := gcore.NewRouter(ctx, "routerResource", &gcore.RouterArgs{
ExternalGatewayInfo: &gcore.RouterExternalGatewayInfoArgs{
EnableSnat: pulumi.Bool(false),
ExternalFixedIps: gcore.RouterExternalGatewayInfoExternalFixedIpArray{
&gcore.RouterExternalGatewayInfoExternalFixedIpArgs{
IpAddress: pulumi.String("string"),
SubnetId: pulumi.String("string"),
},
},
NetworkId: pulumi.String("string"),
Type: pulumi.String("string"),
},
Interfaces: gcore.RouterInterfaceArray{
&gcore.RouterInterfaceArgs{
SubnetId: pulumi.String("string"),
Type: pulumi.String("string"),
IpAddress: pulumi.String("string"),
MacAddress: pulumi.String("string"),
NetworkId: pulumi.String("string"),
PortId: pulumi.String("string"),
},
},
Name: pulumi.String("string"),
ProjectId: pulumi.Float64(0),
ProjectName: pulumi.String("string"),
RegionId: pulumi.Float64(0),
RegionName: pulumi.String("string"),
RouterId: pulumi.String("string"),
Routes: gcore.RouterRouteArray{
&gcore.RouterRouteArgs{
Destination: pulumi.String("string"),
Nexthop: pulumi.String("string"),
},
},
})
var routerResource = new Router("routerResource", RouterArgs.builder()
.externalGatewayInfo(RouterExternalGatewayInfoArgs.builder()
.enableSnat(false)
.externalFixedIps(RouterExternalGatewayInfoExternalFixedIpArgs.builder()
.ipAddress("string")
.subnetId("string")
.build())
.networkId("string")
.type("string")
.build())
.interfaces(RouterInterfaceArgs.builder()
.subnetId("string")
.type("string")
.ipAddress("string")
.macAddress("string")
.networkId("string")
.portId("string")
.build())
.name("string")
.projectId(0)
.projectName("string")
.regionId(0)
.regionName("string")
.routerId("string")
.routes(RouterRouteArgs.builder()
.destination("string")
.nexthop("string")
.build())
.build());
router_resource = gcore.Router("routerResource",
external_gateway_info={
"enable_snat": False,
"external_fixed_ips": [{
"ip_address": "string",
"subnet_id": "string",
}],
"network_id": "string",
"type": "string",
},
interfaces=[{
"subnet_id": "string",
"type": "string",
"ip_address": "string",
"mac_address": "string",
"network_id": "string",
"port_id": "string",
}],
name="string",
project_id=0,
project_name="string",
region_id=0,
region_name="string",
router_id="string",
routes=[{
"destination": "string",
"nexthop": "string",
}])
const routerResource = new gcore.Router("routerResource", {
externalGatewayInfo: {
enableSnat: false,
externalFixedIps: [{
ipAddress: "string",
subnetId: "string",
}],
networkId: "string",
type: "string",
},
interfaces: [{
subnetId: "string",
type: "string",
ipAddress: "string",
macAddress: "string",
networkId: "string",
portId: "string",
}],
name: "string",
projectId: 0,
projectName: "string",
regionId: 0,
regionName: "string",
routerId: "string",
routes: [{
destination: "string",
nexthop: "string",
}],
});
type: gcore:Router
properties:
externalGatewayInfo:
enableSnat: false
externalFixedIps:
- ipAddress: string
subnetId: string
networkId: string
type: string
interfaces:
- ipAddress: string
macAddress: string
networkId: string
portId: string
subnetId: string
type: string
name: string
projectId: 0
projectName: string
regionId: 0
regionName: string
routerId: string
routes:
- destination: string
nexthop: string
Router 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 Router resource accepts the following input properties:
- External
Gateway RouterInfo External Gateway Info - Interfaces
List<Router
Interface> - Name string
- Project
Id double - Project
Name string - Region
Id double - Region
Name string - Router
Id string - The ID of this resource.
- Routes
List<Router
Route>
- External
Gateway RouterInfo External Gateway Info Args - Interfaces
[]Router
Interface Args - Name string
- Project
Id float64 - Project
Name string - Region
Id float64 - Region
Name string - Router
Id string - The ID of this resource.
- Routes
[]Router
Route Args
- external
Gateway RouterInfo External Gateway Info - interfaces
List<Router
Interface> - name String
- project
Id Double - project
Name String - region
Id Double - region
Name String - router
Id String - The ID of this resource.
- routes
List<Router
Route>
- external
Gateway RouterInfo External Gateway Info - interfaces
Router
Interface[] - name string
- project
Id number - project
Name string - region
Id number - region
Name string - router
Id string - The ID of this resource.
- routes
Router
Route[]
- external_
gateway_ Routerinfo External Gateway Info Args - interfaces
Sequence[Router
Interface Args] - name str
- project_
id float - project_
name str - region_
id float - region_
name str - router_
id str - The ID of this resource.
- routes
Sequence[Router
Route Args]
- external
Gateway Property MapInfo - interfaces List<Property Map>
- name String
- project
Id Number - project
Name String - region
Id Number - region
Name String - router
Id String - The ID of this resource.
- routes List<Property Map>
Outputs
All input properties are implicitly available as output properties. Additionally, the Router resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Last
Updated string
- Id string
- The provider-assigned unique ID for this managed resource.
- Last
Updated string
- id String
- The provider-assigned unique ID for this managed resource.
- last
Updated String
- id string
- The provider-assigned unique ID for this managed resource.
- last
Updated string
- id str
- The provider-assigned unique ID for this managed resource.
- last_
updated str
- id String
- The provider-assigned unique ID for this managed resource.
- last
Updated String
Look up Existing Router Resource
Get an existing Router 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?: RouterState, opts?: CustomResourceOptions): Router
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
external_gateway_info: Optional[RouterExternalGatewayInfoArgs] = None,
interfaces: Optional[Sequence[RouterInterfaceArgs]] = None,
last_updated: 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,
router_id: Optional[str] = None,
routes: Optional[Sequence[RouterRouteArgs]] = None) -> Router
func GetRouter(ctx *Context, name string, id IDInput, state *RouterState, opts ...ResourceOption) (*Router, error)
public static Router Get(string name, Input<string> id, RouterState? state, CustomResourceOptions? opts = null)
public static Router get(String name, Output<String> id, RouterState state, CustomResourceOptions options)
resources: _: type: gcore:Router 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.
- External
Gateway RouterInfo External Gateway Info - Interfaces
List<Router
Interface> - Last
Updated string - Name string
- Project
Id double - Project
Name string - Region
Id double - Region
Name string - Router
Id string - The ID of this resource.
- Routes
List<Router
Route>
- External
Gateway RouterInfo External Gateway Info Args - Interfaces
[]Router
Interface Args - Last
Updated string - Name string
- Project
Id float64 - Project
Name string - Region
Id float64 - Region
Name string - Router
Id string - The ID of this resource.
- Routes
[]Router
Route Args
- external
Gateway RouterInfo External Gateway Info - interfaces
List<Router
Interface> - last
Updated String - name String
- project
Id Double - project
Name String - region
Id Double - region
Name String - router
Id String - The ID of this resource.
- routes
List<Router
Route>
- external
Gateway RouterInfo External Gateway Info - interfaces
Router
Interface[] - last
Updated string - name string
- project
Id number - project
Name string - region
Id number - region
Name string - router
Id string - The ID of this resource.
- routes
Router
Route[]
- external_
gateway_ Routerinfo External Gateway Info Args - interfaces
Sequence[Router
Interface Args] - last_
updated str - name str
- project_
id float - project_
name str - region_
id float - region_
name str - router_
id str - The ID of this resource.
- routes
Sequence[Router
Route Args]
- external
Gateway Property MapInfo - interfaces List<Property Map>
- last
Updated String - name String
- project
Id Number - project
Name String - region
Id Number - region
Name String - router
Id String - The ID of this resource.
- routes List<Property Map>
Supporting Types
RouterExternalGatewayInfo, RouterExternalGatewayInfoArgs
- Enable
Snat bool - External
Fixed List<RouterIps External Gateway Info External Fixed Ip> - Network
Id string - Id of the external network
- Type string
- Must be 'manual' or 'default'
- Enable
Snat bool - External
Fixed []RouterIps External Gateway Info External Fixed Ip - Network
Id string - Id of the external network
- Type string
- Must be 'manual' or 'default'
- enable
Snat Boolean - external
Fixed List<RouterIps External Gateway Info External Fixed Ip> - network
Id String - Id of the external network
- type String
- Must be 'manual' or 'default'
- enable
Snat boolean - external
Fixed RouterIps External Gateway Info External Fixed Ip[] - network
Id string - Id of the external network
- type string
- Must be 'manual' or 'default'
- enable_
snat bool - external_
fixed_ Sequence[Routerips External Gateway Info External Fixed Ip] - network_
id str - Id of the external network
- type str
- Must be 'manual' or 'default'
- enable
Snat Boolean - external
Fixed List<Property Map>Ips - network
Id String - Id of the external network
- type String
- Must be 'manual' or 'default'
RouterExternalGatewayInfoExternalFixedIp, RouterExternalGatewayInfoExternalFixedIpArgs
- ip_
address str - subnet_
id str
RouterInterface, RouterInterfaceArgs
- subnet_
id str - Subnet for router interface must have a gateway IP
- type str
- must be 'subnet'
- ip_
address str - mac_
address str - network_
id str - port_
id str
RouterRoute, RouterRouteArgs
- Destination string
- Nexthop string
- IPv4 address to forward traffic to if it's destination IP matches 'destination' CIDR
- Destination string
- Nexthop string
- IPv4 address to forward traffic to if it's destination IP matches 'destination' CIDR
- destination String
- nexthop String
- IPv4 address to forward traffic to if it's destination IP matches 'destination' CIDR
- destination string
- nexthop string
- IPv4 address to forward traffic to if it's destination IP matches 'destination' CIDR
- destination str
- nexthop str
- IPv4 address to forward traffic to if it's destination IP matches 'destination' CIDR
- destination String
- nexthop String
- IPv4 address to forward traffic to if it's destination IP matches 'destination' CIDR
Import
import using <project_id>:<region_id>:<router_id> format
$ pulumi import gcore:index/router:Router router1 1:6:447d2959-8ae0-4ca0-8d47-9f050a3637d7
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- gcore g-core/terraform-provider-gcore
- License
- Notes
- This Pulumi package is based on the
gcore
Terraform Provider.