# saif-resources / bot

Creates an Azure Bot Service with app registration identity and optional OAuth connections for SSO.

## Usage

```hcl
module "bot" {
  source  = "app.terraform.io/SAIFCorp/resources/saif//modules/bot"
  version = "~> 1.0.0"

  context  = module.environment.context
  identity = module.identity.identity

  name                = var.project_id
  display_name        = "My Bot"
  resource_group_name = module.resource_group.resource_group_name
  endpoint            = module.api.bot_endpoint

  oauth_connections = {
    sso = {
      client_id     = module.identity.identity.app_client_id
      client_secret = "<client_secret_value>"
      scopes        = "User.Read openid profile"
      parameters    = { tenantId = module.environment.context.tenant_id }
    }
  }
}
```

## Outputs

| Name       | Description                         |
| ---------- | ----------------------------------- |
| `name`     | Azure Bot Service name              |
| `endpoint` | Bot Framework messaging endpoint URL |

<!-- BEGIN_TF_DOCS -->
## Providers

No providers.

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_context"></a> [context](#input\_context) | Platform context from the environment module | `any` | n/a | yes |
| <a name="input_display_name"></a> [display\_name](#input\_display\_name) | Bot display name shown to users. When null or empty, defaults to "${name}-${context.environment\_short\_name} (${context.environment})". | `string` | n/a | yes |
| <a name="input_endpoint"></a> [endpoint](#input\_endpoint) | The Bot Framework messaging endpoint URL (e.g. module.api.bot\_endpoint) | `string` | n/a | yes |
| <a name="input_identity"></a> [identity](#input\_identity) | Identity bundle from the identity module | `any` | n/a | yes |
| <a name="input_microsoft_app_type"></a> [microsoft\_app\_type](#input\_microsoft\_app\_type) | The Microsoft App authentication type (SingleTenant or MultiTenant) | `string` | `"SingleTenant"` | no |
| <a name="input_name"></a> [name](#input\_name) | Bot name suffix (combined with environment\_short\_name) | `string` | n/a | yes |
| <a name="input_oauth_connections"></a> [oauth\_connections](#input\_oauth\_connections) | Map of OAuth connection settings for the bot | <pre>map(object({<br/>    client_id     = string<br/>    client_secret = string<br/>    scopes        = string<br/>    parameters    = optional(map(string), {})<br/>  }))</pre> | `{}` | no |
| <a name="input_resource_group_name"></a> [resource\_group\_name](#input\_resource\_group\_name) | The resource group for the bot service | `string` | n/a | yes |
| <a name="input_sku"></a> [sku](#input\_sku) | The SKU for the Bot Service (F0 or S1) | `string` | `"F0"` | no |

## Outputs

| Name | Description |
|------|-------------|
| <a name="output_endpoint"></a> [endpoint](#output\_endpoint) | The Bot Framework messaging endpoint URL |
| <a name="output_name"></a> [name](#output\_name) | The Azure Bot Service name |

## Resources
    
<!-- END_TF_DOCS -->

---

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