# saif-resources / webapp-route

Composes a Front Door origin group, origin (with Private Link), and route for a web application. Used by `saif-web-service` to wire a web app into the org-level Front Door profile.

## Usage

```hcl
module "webapp_route" {
  source  = "app.terraform.io/SAIFCorp/resources/saif//modules/webapp-route"
  version = "~> 3.5.0"

  context          = module.environment.context
  application_name = var.application_name
  webapp_hostname  = module.webapp.web_app_default_hostname
  webapp_id        = module.webapp.web_app_id
  is_external_app  = var.is_external_app
}
```

## Inputs

| Name | Description | Type | Required |
| ---- | ----------- | ---- | -------- |
| `context` | Platform context from the environment module | `any` | yes |
| `application_name` | Application name used for origin group/origin naming and route path | `string` | yes |
| `webapp_hostname` | The web app's default hostname | `string` | yes |
| `webapp_id` | The web app's resource ID (for Private Link) | `string` | yes |
| `is_external_app` | Whether this app routes through the external Front Door endpoint | `bool` | no |
| `private_link_location` | Azure region for the Private Link connection | `string` | no |
| `origin_path` | Origin path prefix. Defaults to `/{application_name}/` | `string` | no |

## Outputs

| Name | Description |
| ---- | ----------- |
| `origin_group_id` | The Front Door origin group resource ID |
| `origin_id` | The Front Door origin resource ID |
| `route_id` | The Front Door route resource ID |

<!-- BEGIN_TF_DOCS -->
## Providers

| Name | Version |
|------|---------|
| <a name="provider_azurerm"></a> [azurerm](#provider\_azurerm) | >= 4.0, < 5.0 |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_application_name"></a> [application\_name](#input\_application\_name) | Application name used for origin group/origin naming and route path | `string` | n/a | yes |
| <a name="input_context"></a> [context](#input\_context) | Platform context from the environment module | `any` | n/a | yes |
| <a name="input_is_external_app"></a> [is\_external\_app](#input\_is\_external\_app) | Whether this app routes through the external Front Door endpoint (vs internal) | `bool` | `false` | no |
| <a name="input_origin_path"></a> [origin\_path](#input\_origin\_path) | Origin path prefix appended to the route (e.g. '/appname/'). Defaults to '/{application\_name}/'. | `string` | `null` | no |
| <a name="input_private_link_location"></a> [private\_link\_location](#input\_private\_link\_location) | Azure region for the Private Link connection (must match the region where the origin resource is deployed, typically westus3 for SAIF) | `string` | `"westus3"` | no |
| <a name="input_webapp_hostname"></a> [webapp\_hostname](#input\_webapp\_hostname) | The web app's default hostname (from module.webapp output) | `string` | n/a | yes |
| <a name="input_webapp_id"></a> [webapp\_id](#input\_webapp\_id) | The web app's resource ID (for Private Link connectivity) | `string` | n/a | yes |

## Outputs

| Name | Description |
|------|-------------|
| <a name="output_origin_group_id"></a> [origin\_group\_id](#output\_origin\_group\_id) | The Front Door origin group resource ID |
| <a name="output_origin_id"></a> [origin\_id](#output\_origin\_id) | The Front Door origin resource ID |
| <a name="output_route_id"></a> [route\_id](#output\_route\_id) | The Front Door route resource ID |

## Resources


- resource.azurerm_cdn_frontdoor_custom_domain_association.main (/terraform-docs/modules/webapp-route/main.tf#83)
- resource.azurerm_cdn_frontdoor_origin.origin (/terraform-docs/modules/webapp-route/main.tf#44)
- resource.azurerm_cdn_frontdoor_origin_group.origin_group (/terraform-docs/modules/webapp-route/main.tf#29)    
<!-- END_TF_DOCS -->

---

[View source on GitHub](https://github.com/saif-corp/forge/blob/main/src/terraform/saif-resources/modules/webapp-route/README.md)
