-
Notifications
You must be signed in to change notification settings - Fork 87
resource_route
Provides a Cloud Foundry resource for managing Cloud Foundry application routes.
The following example creates an route for an application.
resource "cloudfoundry_route" "default" {
domain = data.cloudfoundry_domain.apps.domain.id
space = data.cloudfoundry_space.dev.id
hostname = "myapp"
}
The following arguments are supported:
-
domain
- (Required, String) The ID of the domain to map the host name to. If not provided the default application domain will be used. -
space
- (Required, String) The ID of the space to create the route in. -
hostname
- (Required, Optional) The application's host name. This is required for shared domains.
The following arguments apply only to TCP routes.
-
port
- (Optional, Int) The port to associate with the route for a TCP route. Conflicts withrandom_port
. -
random_port
- (Optional, Bool) Set to 'true' to create a random port. Conflicts withport
and defaults to false.
The following argument applies only to HTTP routes.
-
path
- (Optional) A path for a HTTP route.
The following maps the route to an application.
-
target
- (Optional, Set) 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.
Thetarget
block supports:-
app
- (Required, String) The ID of the application to map this route to. -
port
- (Optional, Int) 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 the cloudfoundry_app.routes
attributes.
~> NOTE: Resource only handles target
previously created by resource (i.e. it does not destroy nor modifies target set by other resources like cloudfoundry_application).
The following attributes are exported along with any defaults for the inputs attributes.
-
id
- The GUID of the route -
endpoint
- The complete endpoint with path if set for the route
The current Route can be imported using the route
, e.g.
$ terraform import cloudfoundry_route.default a-guid
- cloudfoundry_app
- cloudfoundry_asg
- cloudfoundry_domain
- cloudfoundry_info
- cloudfoundry_isolation_segment
- cloudfoundry_org
- cloudfoundry_org_quota
- cloudfoundry_route
- cloudfoundry_router_group
- cloudfoundry_service
- cloudfoundry_service_instance
- cloudfoundry_service_key
- cloudfoundry_space
- cloudfoundry_space_quota
- cloudfoundry_stack
- cloudfoundry_user
- cloudfoundry_user_provided_service
- cloudfoundry_app
- cloudfoundry_asg
- cloudfoundry_buildpack
- cloudfoundry_default_asg
- cloudfoundry_domain
- cloudfoundry_evg
- cloudfoundry_feature_flag
- cloudfoundry_isolation_segment
- cloudfoundry_isolation_segment_entitlement
- cloudfoundry_network_policy
- cloudfoundry_org
- cloudfoundry_org_quota
- cloudfoundry_org_users
- cloudfoundry_private_domain_access
- cloudfoundry_route
- cloudfoundry_route_service_binding
- cloudfoundry_service_broker
- cloudfoundry_service_instance
- cloudfoundry_service_key
- cloudfoundry_service_plan_access
- cloudfoundry_space
- cloudfoundry_space_quota
- cloudfoundry_space_users
- cloudfoundry_user
- cloudfoundry_user_provided_service