cloudfoundry.Route
Explore with Pulumi AI
Provides a Cloud Foundry resource for managing Cloud Foundry application routes.
Example Usage
The following example creates an route for an application.
import * as pulumi from "@pulumi/pulumi";
import * as cloudfoundry from "@pulumi/cloudfoundry";
const _default = new cloudfoundry.Route("default", {
domain: data.cloudfoundry_domain.apps.domain.id,
space: data.cloudfoundry_space.dev.id,
hostname: "myapp",
});
import pulumi
import pulumi_cloudfoundry as cloudfoundry
default = cloudfoundry.Route("default",
domain=data["cloudfoundry_domain"]["apps"]["domain"]["id"],
space=data["cloudfoundry_space"]["dev"]["id"],
hostname="myapp")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/cloudfoundry/cloudfoundry"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := cloudfoundry.NewRoute(ctx, "default", &cloudfoundry.RouteArgs{
Domain: pulumi.Any(data.Cloudfoundry_domain.Apps.Domain.Id),
Space: pulumi.Any(data.Cloudfoundry_space.Dev.Id),
Hostname: pulumi.String("myapp"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cloudfoundry = Pulumi.Cloudfoundry;
return await Deployment.RunAsync(() =>
{
var @default = new Cloudfoundry.Route("default", new()
{
Domain = data.Cloudfoundry_domain.Apps.Domain.Id,
Space = data.Cloudfoundry_space.Dev.Id,
Hostname = "myapp",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudfoundry.Route;
import com.pulumi.cloudfoundry.RouteArgs;
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) {
var default_ = new Route("default", RouteArgs.builder()
.domain(data.cloudfoundry_domain().apps().domain().id())
.space(data.cloudfoundry_space().dev().id())
.hostname("myapp")
.build());
}
}
resources:
default:
type: cloudfoundry:Route
properties:
domain: ${data.cloudfoundry_domain.apps.domain.id}
space: ${data.cloudfoundry_space.dev.id}
hostname: myapp
Create Route Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Route(name: string, args: RouteArgs, opts?: CustomResourceOptions);
@overload
def Route(resource_name: str,
args: RouteArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Route(resource_name: str,
opts: Optional[ResourceOptions] = None,
domain: Optional[str] = None,
space: Optional[str] = None,
hostname: Optional[str] = None,
path: Optional[str] = None,
port: Optional[float] = None,
route_id: Optional[str] = None,
targets: Optional[Sequence[RouteTargetArgs]] = None)
func NewRoute(ctx *Context, name string, args RouteArgs, opts ...ResourceOption) (*Route, error)
public Route(string name, RouteArgs args, CustomResourceOptions? opts = null)
type: cloudfoundry:Route
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 RouteArgs
- 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 RouteArgs
- 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 RouteArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RouteArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RouteArgs
- 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 routeResource = new Cloudfoundry.Route("routeResource", new()
{
Domain = "string",
Space = "string",
Hostname = "string",
Path = "string",
Port = 0,
RouteId = "string",
Targets = new[]
{
new Cloudfoundry.Inputs.RouteTargetArgs
{
App = "string",
Port = 0,
},
},
});
example, err := cloudfoundry.NewRoute(ctx, "routeResource", &cloudfoundry.RouteArgs{
Domain: pulumi.String("string"),
Space: pulumi.String("string"),
Hostname: pulumi.String("string"),
Path: pulumi.String("string"),
Port: pulumi.Float64(0),
RouteId: pulumi.String("string"),
Targets: cloudfoundry.RouteTargetArray{
&cloudfoundry.RouteTargetArgs{
App: pulumi.String("string"),
Port: pulumi.Float64(0),
},
},
})
var routeResource = new Route("routeResource", RouteArgs.builder()
.domain("string")
.space("string")
.hostname("string")
.path("string")
.port(0)
.routeId("string")
.targets(RouteTargetArgs.builder()
.app("string")
.port(0)
.build())
.build());
route_resource = cloudfoundry.Route("routeResource",
domain="string",
space="string",
hostname="string",
path="string",
port=0,
route_id="string",
targets=[{
"app": "string",
"port": 0,
}])
const routeResource = new cloudfoundry.Route("routeResource", {
domain: "string",
space: "string",
hostname: "string",
path: "string",
port: 0,
routeId: "string",
targets: [{
app: "string",
port: 0,
}],
});
type: cloudfoundry:Route
properties:
domain: string
hostname: string
path: string
port: 0
routeId: string
space: string
targets:
- app: string
port: 0
Route 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 Route resource accepts the following input properties:
- Domain string
- The ID of the domain to map the host name to. If not provided the default application domain will be used.
- Space string
- The ID of the space to create the route in.
- Hostname string
The application's host name. This is required for shared domains.
The following arguments apply only to TCP routes.
- Path string
A path for a HTTP route.
The following maps the route to an application.
- Port double
The port to associate with the route for a TCP route. Conflicts with
random_port
.The following argument applies only to HTTP routes.
- Route
Id string - The GUID of the route
- Targets
List<Route
Target> - One or more route mapping(s) that will map this route to application(s). Can be repeated multiple times to load balance route traffic among multiple applications.
The
target
block supports:
- Domain string
- The ID of the domain to map the host name to. If not provided the default application domain will be used.
- Space string
- The ID of the space to create the route in.
- Hostname string
The application's host name. This is required for shared domains.
The following arguments apply only to TCP routes.
- Path string
A path for a HTTP route.
The following maps the route to an application.
- Port float64
The port to associate with the route for a TCP route. Conflicts with
random_port
.The following argument applies only to HTTP routes.
- Route
Id string - The GUID of the route
- Targets
[]Route
Target Args - One or more route mapping(s) that will map this route to application(s). Can be repeated multiple times to load balance route traffic among multiple applications.
The
target
block supports:
- domain String
- The ID of the domain to map the host name to. If not provided the default application domain will be used.
- space String
- The ID of the space to create the route in.
- hostname String
The application's host name. This is required for shared domains.
The following arguments apply only to TCP routes.
- path String
A path for a HTTP route.
The following maps the route to an application.
- port Double
The port to associate with the route for a TCP route. Conflicts with
random_port
.The following argument applies only to HTTP routes.
- route
Id String - The GUID of the route
- targets
List<Route
Target> - One or more route mapping(s) that will map this route to application(s). Can be repeated multiple times to load balance route traffic among multiple applications.
The
target
block supports:
- domain string
- The ID of the domain to map the host name to. If not provided the default application domain will be used.
- space string
- The ID of the space to create the route in.
- hostname string
The application's host name. This is required for shared domains.
The following arguments apply only to TCP routes.
- path string
A path for a HTTP route.
The following maps the route to an application.
- port number
The port to associate with the route for a TCP route. Conflicts with
random_port
.The following argument applies only to HTTP routes.
- route
Id string - The GUID of the route
- targets
Route
Target[] - One or more route mapping(s) that will map this route to application(s). Can be repeated multiple times to load balance route traffic among multiple applications.
The
target
block supports:
- domain str
- The ID of the domain to map the host name to. If not provided the default application domain will be used.
- space str
- The ID of the space to create the route in.
- hostname str
The application's host name. This is required for shared domains.
The following arguments apply only to TCP routes.
- path str
A path for a HTTP route.
The following maps the route to an application.
- port float
The port to associate with the route for a TCP route. Conflicts with
random_port
.The following argument applies only to HTTP routes.
- route_
id str - The GUID of the route
- targets
Sequence[Route
Target Args] - One or more route mapping(s) that will map this route to application(s). Can be repeated multiple times to load balance route traffic among multiple applications.
The
target
block supports:
- domain String
- The ID of the domain to map the host name to. If not provided the default application domain will be used.
- space String
- The ID of the space to create the route in.
- hostname String
The application's host name. This is required for shared domains.
The following arguments apply only to TCP routes.
- path String
A path for a HTTP route.
The following maps the route to an application.
- port Number
The port to associate with the route for a TCP route. Conflicts with
random_port
.The following argument applies only to HTTP routes.
- route
Id String - The GUID of the route
- targets List<Property Map>
- One or more route mapping(s) that will map this route to application(s). Can be repeated multiple times to load balance route traffic among multiple applications.
The
target
block supports:
Outputs
All input properties are implicitly available as output properties. Additionally, the Route resource produces the following output properties:
Look up Existing Route Resource
Get an existing Route 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?: RouteState, opts?: CustomResourceOptions): Route
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
domain: Optional[str] = None,
endpoint: Optional[str] = None,
hostname: Optional[str] = None,
path: Optional[str] = None,
port: Optional[float] = None,
route_id: Optional[str] = None,
space: Optional[str] = None,
targets: Optional[Sequence[RouteTargetArgs]] = None) -> Route
func GetRoute(ctx *Context, name string, id IDInput, state *RouteState, opts ...ResourceOption) (*Route, error)
public static Route Get(string name, Input<string> id, RouteState? state, CustomResourceOptions? opts = null)
public static Route get(String name, Output<String> id, RouteState state, CustomResourceOptions options)
resources: _: type: cloudfoundry:Route 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.
- Domain string
- The ID of the domain to map the host name to. If not provided the default application domain will be used.
- Endpoint string
- The complete endpoint with path if set for the route
- Hostname string
The application's host name. This is required for shared domains.
The following arguments apply only to TCP routes.
- Path string
A path for a HTTP route.
The following maps the route to an application.
- Port double
The port to associate with the route for a TCP route. Conflicts with
random_port
.The following argument applies only to HTTP routes.
- Route
Id string - The GUID of the route
- Space string
- The ID of the space to create the route in.
- Targets
List<Route
Target> - One or more route mapping(s) that will map this route to application(s). Can be repeated multiple times to load balance route traffic among multiple applications.
The
target
block supports:
- Domain string
- The ID of the domain to map the host name to. If not provided the default application domain will be used.
- Endpoint string
- The complete endpoint with path if set for the route
- Hostname string
The application's host name. This is required for shared domains.
The following arguments apply only to TCP routes.
- Path string
A path for a HTTP route.
The following maps the route to an application.
- Port float64
The port to associate with the route for a TCP route. Conflicts with
random_port
.The following argument applies only to HTTP routes.
- Route
Id string - The GUID of the route
- Space string
- The ID of the space to create the route in.
- Targets
[]Route
Target Args - One or more route mapping(s) that will map this route to application(s). Can be repeated multiple times to load balance route traffic among multiple applications.
The
target
block supports:
- domain String
- The ID of the domain to map the host name to. If not provided the default application domain will be used.
- endpoint String
- The complete endpoint with path if set for the route
- hostname String
The application's host name. This is required for shared domains.
The following arguments apply only to TCP routes.
- path String
A path for a HTTP route.
The following maps the route to an application.
- port Double
The port to associate with the route for a TCP route. Conflicts with
random_port
.The following argument applies only to HTTP routes.
- route
Id String - The GUID of the route
- space String
- The ID of the space to create the route in.
- targets
List<Route
Target> - One or more route mapping(s) that will map this route to application(s). Can be repeated multiple times to load balance route traffic among multiple applications.
The
target
block supports:
- domain string
- The ID of the domain to map the host name to. If not provided the default application domain will be used.
- endpoint string
- The complete endpoint with path if set for the route
- hostname string
The application's host name. This is required for shared domains.
The following arguments apply only to TCP routes.
- path string
A path for a HTTP route.
The following maps the route to an application.
- port number
The port to associate with the route for a TCP route. Conflicts with
random_port
.The following argument applies only to HTTP routes.
- route
Id string - The GUID of the route
- space string
- The ID of the space to create the route in.
- targets
Route
Target[] - One or more route mapping(s) that will map this route to application(s). Can be repeated multiple times to load balance route traffic among multiple applications.
The
target
block supports:
- domain str
- The ID of the domain to map the host name to. If not provided the default application domain will be used.
- endpoint str
- The complete endpoint with path if set for the route
- hostname str
The application's host name. This is required for shared domains.
The following arguments apply only to TCP routes.
- path str
A path for a HTTP route.
The following maps the route to an application.
- port float
The port to associate with the route for a TCP route. Conflicts with
random_port
.The following argument applies only to HTTP routes.
- route_
id str - The GUID of the route
- space str
- The ID of the space to create the route in.
- targets
Sequence[Route
Target Args] - One or more route mapping(s) that will map this route to application(s). Can be repeated multiple times to load balance route traffic among multiple applications.
The
target
block supports:
- domain String
- The ID of the domain to map the host name to. If not provided the default application domain will be used.
- endpoint String
- The complete endpoint with path if set for the route
- hostname String
The application's host name. This is required for shared domains.
The following arguments apply only to TCP routes.
- path String
A path for a HTTP route.
The following maps the route to an application.
- port Number
The port to associate with the route for a TCP route. Conflicts with
random_port
.The following argument applies only to HTTP routes.
- route
Id String - The GUID of the route
- space String
- The ID of the space to create the route in.
- targets List<Property Map>
- One or more route mapping(s) that will map this route to application(s). Can be repeated multiple times to load balance route traffic among multiple applications.
The
target
block supports:
Supporting Types
RouteTarget, RouteTargetArgs
- App string
- The ID of the application to map this route to.
- Port double
A port that the application will be listening on. If this argument is not provided then the route will be associated with the application's default port.
NOTE: Route mappings can be controlled from either the
cloudfoundry_routes.target
or thecloudfoundry_app.routes
attributes. NOTE: Resource only handlestarget
previously created by resource (i.e. it does not destroy nor modifies target set by other resources like cloudfoundry_application).
- App string
- The ID of the application to map this route to.
- Port float64
A port that the application will be listening on. If this argument is not provided then the route will be associated with the application's default port.
NOTE: Route mappings can be controlled from either the
cloudfoundry_routes.target
or thecloudfoundry_app.routes
attributes. NOTE: Resource only handlestarget
previously created by resource (i.e. it does not destroy nor modifies target set by other resources like cloudfoundry_application).
- app String
- The ID of the application to map this route to.
- port Double
A port that the application will be listening on. If this argument is not provided then the route will be associated with the application's default port.
NOTE: Route mappings can be controlled from either the
cloudfoundry_routes.target
or thecloudfoundry_app.routes
attributes. NOTE: Resource only handlestarget
previously created by resource (i.e. it does not destroy nor modifies target set by other resources like cloudfoundry_application).
- app string
- The ID of the application to map this route to.
- port number
A port that the application will be listening on. If this argument is not provided then the route will be associated with the application's default port.
NOTE: Route mappings can be controlled from either the
cloudfoundry_routes.target
or thecloudfoundry_app.routes
attributes. NOTE: Resource only handlestarget
previously created by resource (i.e. it does not destroy nor modifies target set by other resources like cloudfoundry_application).
- app str
- The ID of the application to map this route to.
- port float
A port that the application will be listening on. If this argument is not provided then the route will be associated with the application's default port.
NOTE: Route mappings can be controlled from either the
cloudfoundry_routes.target
or thecloudfoundry_app.routes
attributes. NOTE: Resource only handlestarget
previously created by resource (i.e. it does not destroy nor modifies target set by other resources like cloudfoundry_application).
- app String
- The ID of the application to map this route to.
- port Number
A port that the application will be listening on. If this argument is not provided then the route will be associated with the application's default port.
NOTE: Route mappings can be controlled from either the
cloudfoundry_routes.target
or thecloudfoundry_app.routes
attributes. NOTE: Resource only handlestarget
previously created by resource (i.e. it does not destroy nor modifies target set by other resources like cloudfoundry_application).
Import
The current Route can be imported using the route
, e.g.
bash
$ pulumi import cloudfoundry:index/route:Route default a-guid
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- cloudfoundry cloudfoundry-community/terraform-provider-cloudfoundry
- License
- Notes
- This Pulumi package is based on the
cloudfoundry
Terraform Provider.