ionoscloud.getApigatewayRoute
Explore with Pulumi AI
The API Gateway Route data source can be used to search for and return an existing API Gateway route. You can provide a string for the name parameter which will be compared with provisioned API Gateway routes. If a single match is found, it will be returned. If your search results in multiple matches, an error will be returned. When this happens, please refine your search string so that it is specific enough to return only one result.
Example Usage
By ID
import * as pulumi from "@pulumi/pulumi";
import * as ionoscloud from "@pulumi/ionoscloud";
const example = ionoscloud.getApigatewayRoute({
gatewayId: "your_gateway_id",
id: "your_apigateway_route_id",
});
import pulumi
import pulumi_ionoscloud as ionoscloud
example = ionoscloud.get_apigateway_route(gateway_id="your_gateway_id",
id="your_apigateway_route_id")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ionoscloud/v6/ionoscloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ionoscloud.LookupApigatewayRoute(ctx, &ionoscloud.LookupApigatewayRouteArgs{
GatewayId: "your_gateway_id",
Id: pulumi.StringRef("your_apigateway_route_id"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ionoscloud = Pulumi.Ionoscloud;
return await Deployment.RunAsync(() =>
{
var example = Ionoscloud.GetApigatewayRoute.Invoke(new()
{
GatewayId = "your_gateway_id",
Id = "your_apigateway_route_id",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.IonoscloudFunctions;
import com.pulumi.ionoscloud.inputs.GetApigatewayRouteArgs;
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 example = IonoscloudFunctions.getApigatewayRoute(GetApigatewayRouteArgs.builder()
.gatewayId("your_gateway_id")
.id("your_apigateway_route_id")
.build());
}
}
variables:
example:
fn::invoke:
function: ionoscloud:getApigatewayRoute
arguments:
gatewayId: your_gateway_id
id: your_apigateway_route_id
By Name
Needs to have the resource be previously created, or a depends_on clause to ensure that the resource is created before this data source is called.
import * as pulumi from "@pulumi/pulumi";
import * as ionoscloud from "@pulumi/ionoscloud";
const example = ionoscloud.getApigatewayRoute({
gatewayId: "your_gateway_id",
name: "apigateway-route",
});
import pulumi
import pulumi_ionoscloud as ionoscloud
example = ionoscloud.get_apigateway_route(gateway_id="your_gateway_id",
name="apigateway-route")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ionoscloud/v6/ionoscloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ionoscloud.LookupApigatewayRoute(ctx, &ionoscloud.LookupApigatewayRouteArgs{
GatewayId: "your_gateway_id",
Name: pulumi.StringRef("apigateway-route"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ionoscloud = Pulumi.Ionoscloud;
return await Deployment.RunAsync(() =>
{
var example = Ionoscloud.GetApigatewayRoute.Invoke(new()
{
GatewayId = "your_gateway_id",
Name = "apigateway-route",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.IonoscloudFunctions;
import com.pulumi.ionoscloud.inputs.GetApigatewayRouteArgs;
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 example = IonoscloudFunctions.getApigatewayRoute(GetApigatewayRouteArgs.builder()
.gatewayId("your_gateway_id")
.name("apigateway-route")
.build());
}
}
variables:
example:
fn::invoke:
function: ionoscloud:getApigatewayRoute
arguments:
gatewayId: your_gateway_id
name: apigateway-route
Using getApigatewayRoute
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 getApigatewayRoute(args: GetApigatewayRouteArgs, opts?: InvokeOptions): Promise<GetApigatewayRouteResult>
function getApigatewayRouteOutput(args: GetApigatewayRouteOutputArgs, opts?: InvokeOptions): Output<GetApigatewayRouteResult>
def get_apigateway_route(gateway_id: Optional[str] = None,
id: Optional[str] = None,
name: Optional[str] = None,
partial_match: Optional[bool] = None,
opts: Optional[InvokeOptions] = None) -> GetApigatewayRouteResult
def get_apigateway_route_output(gateway_id: Optional[pulumi.Input[str]] = None,
id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
partial_match: Optional[pulumi.Input[bool]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetApigatewayRouteResult]
func LookupApigatewayRoute(ctx *Context, args *LookupApigatewayRouteArgs, opts ...InvokeOption) (*LookupApigatewayRouteResult, error)
func LookupApigatewayRouteOutput(ctx *Context, args *LookupApigatewayRouteOutputArgs, opts ...InvokeOption) LookupApigatewayRouteResultOutput
> Note: This function is named LookupApigatewayRoute
in the Go SDK.
public static class GetApigatewayRoute
{
public static Task<GetApigatewayRouteResult> InvokeAsync(GetApigatewayRouteArgs args, InvokeOptions? opts = null)
public static Output<GetApigatewayRouteResult> Invoke(GetApigatewayRouteInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetApigatewayRouteResult> getApigatewayRoute(GetApigatewayRouteArgs args, InvokeOptions options)
public static Output<GetApigatewayRouteResult> getApigatewayRoute(GetApigatewayRouteArgs args, InvokeOptions options)
fn::invoke:
function: ionoscloud:index/getApigatewayRoute:getApigatewayRoute
arguments:
# arguments dictionary
The following arguments are supported:
- Gateway
Id string - The ID of the API Gateway that the route belongs to.
- Id string
- ID of an existing API Gateway Route that you want to search for.
- Name string
- Name of an existing API Gateway Route that you want to search for.
- Partial
Match bool
- Gateway
Id string - The ID of the API Gateway that the route belongs to.
- Id string
- ID of an existing API Gateway Route that you want to search for.
- Name string
- Name of an existing API Gateway Route that you want to search for.
- Partial
Match bool
- gateway
Id String - The ID of the API Gateway that the route belongs to.
- id String
- ID of an existing API Gateway Route that you want to search for.
- name String
- Name of an existing API Gateway Route that you want to search for.
- partial
Match Boolean
- gateway
Id string - The ID of the API Gateway that the route belongs to.
- id string
- ID of an existing API Gateway Route that you want to search for.
- name string
- Name of an existing API Gateway Route that you want to search for.
- partial
Match boolean
- gateway_
id str - The ID of the API Gateway that the route belongs to.
- id str
- ID of an existing API Gateway Route that you want to search for.
- name str
- Name of an existing API Gateway Route that you want to search for.
- partial_
match bool
- gateway
Id String - The ID of the API Gateway that the route belongs to.
- id String
- ID of an existing API Gateway Route that you want to search for.
- name String
- Name of an existing API Gateway Route that you want to search for.
- partial
Match Boolean
getApigatewayRoute Result
The following output properties are available:
- Gateway
Id string - Id string
- ID of the API Gateway Route.
- Methods List<string>
- The HTTP methods that the route should match.
- Name string
- The name of the API Gateway Route.
- Paths List<string>
- The paths that the route should match.
- Type string
- This field specifies the protocol used by the ingress to route traffic to the backend service.
- Upstreams
List<Get
Apigateway Route Upstream> - Websocket bool
- Shows whether websocket support is enabled or disabled.
- Partial
Match bool
- Gateway
Id string - Id string
- ID of the API Gateway Route.
- Methods []string
- The HTTP methods that the route should match.
- Name string
- The name of the API Gateway Route.
- Paths []string
- The paths that the route should match.
- Type string
- This field specifies the protocol used by the ingress to route traffic to the backend service.
- Upstreams
[]Get
Apigateway Route Upstream - Websocket bool
- Shows whether websocket support is enabled or disabled.
- Partial
Match bool
- gateway
Id String - id String
- ID of the API Gateway Route.
- methods List<String>
- The HTTP methods that the route should match.
- name String
- The name of the API Gateway Route.
- paths List<String>
- The paths that the route should match.
- type String
- This field specifies the protocol used by the ingress to route traffic to the backend service.
- upstreams
List<Get
Apigateway Route Upstream> - websocket Boolean
- Shows whether websocket support is enabled or disabled.
- partial
Match Boolean
- gateway
Id string - id string
- ID of the API Gateway Route.
- methods string[]
- The HTTP methods that the route should match.
- name string
- The name of the API Gateway Route.
- paths string[]
- The paths that the route should match.
- type string
- This field specifies the protocol used by the ingress to route traffic to the backend service.
- upstreams
Get
Apigateway Route Upstream[] - websocket boolean
- Shows whether websocket support is enabled or disabled.
- partial
Match boolean
- gateway_
id str - id str
- ID of the API Gateway Route.
- methods Sequence[str]
- The HTTP methods that the route should match.
- name str
- The name of the API Gateway Route.
- paths Sequence[str]
- The paths that the route should match.
- type str
- This field specifies the protocol used by the ingress to route traffic to the backend service.
- upstreams
Sequence[Get
Apigateway Route Upstream] - websocket bool
- Shows whether websocket support is enabled or disabled.
- partial_
match bool
- gateway
Id String - id String
- ID of the API Gateway Route.
- methods List<String>
- The HTTP methods that the route should match.
- name String
- The name of the API Gateway Route.
- paths List<String>
- The paths that the route should match.
- type String
- This field specifies the protocol used by the ingress to route traffic to the backend service.
- upstreams List<Property Map>
- websocket Boolean
- Shows whether websocket support is enabled or disabled.
- partial
Match Boolean
Supporting Types
GetApigatewayRouteUpstream
- Host string
- The host of the upstream.
- Loadbalancer string
- The load balancer algorithm.
- Port double
- The port of the upstream.
- Scheme string
- The target URL of the upstream.
- Weight double
- Weight with which to split traffic to the upstream.
- Host string
- The host of the upstream.
- Loadbalancer string
- The load balancer algorithm.
- Port float64
- The port of the upstream.
- Scheme string
- The target URL of the upstream.
- Weight float64
- Weight with which to split traffic to the upstream.
- host String
- The host of the upstream.
- loadbalancer String
- The load balancer algorithm.
- port Double
- The port of the upstream.
- scheme String
- The target URL of the upstream.
- weight Double
- Weight with which to split traffic to the upstream.
- host string
- The host of the upstream.
- loadbalancer string
- The load balancer algorithm.
- port number
- The port of the upstream.
- scheme string
- The target URL of the upstream.
- weight number
- Weight with which to split traffic to the upstream.
- host str
- The host of the upstream.
- loadbalancer str
- The load balancer algorithm.
- port float
- The port of the upstream.
- scheme str
- The target URL of the upstream.
- weight float
- Weight with which to split traffic to the upstream.
- host String
- The host of the upstream.
- loadbalancer String
- The load balancer algorithm.
- port Number
- The port of the upstream.
- scheme String
- The target URL of the upstream.
- weight Number
- Weight with which to split traffic to the upstream.
Package Details
- Repository
- ionoscloud ionos-cloud/terraform-provider-ionoscloud
- License
- Notes
- This Pulumi package is based on the
ionoscloud
Terraform Provider.