# saif-event-service

<!-- BEGIN_TF_DOCS -->
## Providers

| Name | Version |
| ---- | ------- |
| <a name="provider_azapi"></a> [azapi](#provider\_azapi) | >= 2.0, < 3.0 |
| <a name="provider_azuread"></a> [azuread](#provider\_azuread) | >= 3.0, < 4.0 |
| <a name="provider_azurerm"></a> [azurerm](#provider\_azurerm) | >= 4.0, < 5.0 |

## Inputs

| Name | Description | Type | Default | Required |
| ---- | ----------- | ---- | ------- | :------: |
| <a name="input_api"></a> [api](#input\_api) | n/a | <pre>object({<br/>    name          = string<br/>    type          = string<br/>    open_api_file = string<br/>  })</pre> | n/a | yes |
| <a name="input_authorized_apps"></a> [authorized\_apps](#input\_authorized\_apps) | Forge APIs granted Azure Service Bus Data Sender on this event service's topics so they can publish with the Service Bus SDK. Each project\_id resolves to the app registration service principal "{project\_id}-{environment\_short\_name}". topics limits the grant to the named topics; null grants every topic. | <pre>list(object({<br/>    project_id = string<br/>    topics     = optional(list(string))<br/>  }))</pre> | `[]` | no |
| <a name="input_default_message_ttl"></a> [default\_message\_ttl](#input\_default\_message\_ttl) | ISO 8601 default time-to-live for messages on every topic (e.g. P14D). Null keeps the Azure Service Bus default, which is effectively unlimited. | `string` | `null` | no |
| <a name="input_duplicate_detection_history_time_window"></a> [duplicate\_detection\_history\_time\_window](#input\_duplicate\_detection\_history\_time\_window) | ISO 8601 duplicate detection history window (PT20S to P7D). Only applies when requires\_duplicate\_detection is true. | `string` | `"PT10M"` | no |
| <a name="input_environment"></a> [environment](#input\_environment) | The full name of the environment in which the resources are deployed | `string` | n/a | yes |
| <a name="input_environment_short_name"></a> [environment\_short\_name](#input\_environment\_short\_name) | A short name for the environment (e.g., dev, qa, prod) | `string` | n/a | yes |
| <a name="input_is_production"></a> [is\_production](#input\_is\_production) | Whether this is a production environment | `bool` | `false` | no |
| <a name="input_max_message_size_in_kilobytes"></a> [max\_message\_size\_in\_kilobytes](#input\_max\_message\_size\_in\_kilobytes) | The maximum message size in kilobytes for the Service Bus Topic. | `number` | `1024` | no |
| <a name="input_max_size_in_megabytes"></a> [max\_size\_in\_megabytes](#input\_max\_size\_in\_megabytes) | The maximum size in megabytes for the Service Bus Topic. | `number` | `1024` | no |
| <a name="input_organization_name"></a> [organization\_name](#input\_organization\_name) | (Deprecated) The name of the organization. No longer used — kept for backwards compatibility. | `string` | `"saif"` | no |
| <a name="input_owner"></a> [owner](#input\_owner) | The team that owns this service | `string` | `""` | no |
| <a name="input_project_id"></a> [project\_id](#input\_project\_id) | The id of the project. This will be used to name the resources. | `string` | n/a | yes |
| <a name="input_requires_duplicate_detection"></a> [requires\_duplicate\_detection](#input\_requires\_duplicate\_detection) | Enable Service Bus duplicate detection on every topic. The event service sets the message MessageId from the caller's eventId, so a repeated eventId within the history window is dropped silently. Create-only: changing this value recreates the topics, discarding any messages on them. | `bool` | `false` | no |
| <a name="input_secrets"></a> [secrets](#input\_secrets) | A map of secrets from Azure Devops Library | `map(string)` | n/a | yes |
| <a name="input_status"></a> [status](#input\_status) | The status of the Service Bus Topic (e.g., Active, Disabled). | `string` | `"Active"` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | A map of tags to be applied to resources in the module. | `map(string)` | n/a | yes |
| <a name="input_tenant"></a> [tenant](#input\_tenant) | (Deprecated) The name of the tenant. The Azure infra tenant is fixed to Corporate (see local.azure\_tenant in data.tf) — this input is retained for backward compatibility only and is ignored. | `string` | `"Corporate"` | no |

## Outputs

| Name | Description |
| ---- | ----------- |
| <a name="output_api_id"></a> [api\_id](#output\_api\_id) | The ID of the API Management API. |
| <a name="output_api_name"></a> [api\_name](#output\_api\_name) | The name of the API Management API. |
| <a name="output_api_path"></a> [api\_path](#output\_api\_path) | The path of the API Management API. |
| <a name="output_event_url"></a> [event\_url](#output\_event\_url) | Base URL of the event service through the internal Front Door (https://{internal host}/api/{type}/{name}). Null when no API is created. |
| <a name="output_servicebus_namespace_fqdn"></a> [servicebus\_namespace\_fqdn](#output\_servicebus\_namespace\_fqdn) | Fully qualified Service Bus namespace host name that authorized\_apps callers pass to ServiceBusClient. |
| <a name="output_servicebus_topic_ids"></a> [servicebus\_topic\_ids](#output\_servicebus\_topic\_ids) | The IDs of the Service Bus Topics. |
| <a name="output_servicebus_topic_names"></a> [servicebus\_topic\_names](#output\_servicebus\_topic\_names) | The names of the Service Bus Topics. |

## Resources


- resource.azapi_resource.azuremonitor_diagnostic (/terraform-docs/main.tf#66)
- resource.azurerm_cdn_frontdoor_custom_domain_association.main (/terraform-docs/frontdoor.tf#26)
- resource.azurerm_role_assignment.authorized_app_sender (/terraform-docs/authorized_apps.tf#41)
- data source.azuread_service_principal.authorized_app (/terraform-docs/authorized_apps.tf#27)
- data source.azurerm_api_management.shared (/terraform-docs/main.tf#56)    
<!-- END_TF_DOCS -->

---

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