# rds-oracle

Creates an RDS Oracle instance with BYOL licensing, Multi-AZ, KMS encryption, and RDS-managed master password.

Provisions an Oracle EE (or SE2) RDS instance with BYOL or license-included model, encrypted gp3 storage, custom parameter group, Multi-AZ standby, automated backups, enhanced monitoring, Performance Insights, and optional custom option group.

## Usage

```hcl
module "rds_oracle" {
  source  = "hcassc.jfrog.io/iac-terraform-modules-virtual/database/rds-oracle/aws"
  version = "0.1.0"

  identifier         = "prod-oracle"
  subnet_ids         = module.vpc.isolated_subnet_id_list
  security_group_ids = [module.security_groups.ids["rds"]]
  kms_key_id         = module.kms.key_arn
  license_model      = "bring-your-own-license"
}
```

<!-- BEGIN_TF_DOCS — DO NOT EDIT BELOW THIS LINE -->
## Requirements

| Name | Version |
| ---- | ------- |
| <a name="requirement_terraform"></a> [terraform](#requirement_terraform) | ~> 1.5 |
| <a name="requirement_aws"></a> [aws](#requirement_aws) | ~> 6.50 |

## Providers

| Name | Version |
| ---- | ------- |
| <a name="provider_aws"></a> [aws](#provider_aws) | 6.50.0 |

## Resources

| Name | Type |
| ---- | ---- |
| [aws_db_instance.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_instance) | resource |
| [aws_db_parameter_group.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_parameter_group) | resource |
| [aws_db_subnet_group.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_subnet_group) | resource |

## Inputs

| Name | Description | Type | Default | Required |
| ---- | ----------- | ---- | ------- | :------: |
| <a name="input_identifier"></a> [identifier](#input_identifier) | RDS instance identifier | `string` | n/a | yes |
| <a name="input_security_group_ids"></a> [security_group_ids](#input_security_group_ids) | Security group IDs | `list(string)` | n/a | yes |
| <a name="input_subnet_ids"></a> [subnet_ids](#input_subnet_ids) | Subnet IDs for the DB subnet group | `list(string)` | n/a | yes |
| <a name="input_allocated_storage"></a> [allocated_storage](#input_allocated_storage) | Allocated storage in GiB | `number` | `100` | no |
| <a name="input_backup_retention_period"></a> [backup_retention_period](#input_backup_retention_period) | Days to retain automated backups | `number` | `7` | no |
| <a name="input_character_set_name"></a> [character_set_name](#input_character_set_name) | Oracle database character set | `string` | `"AL32UTF8"` | no |
| <a name="input_deletion_protection"></a> [deletion_protection](#input_deletion_protection) | Enable deletion protection | `bool` | `true` | no |
| <a name="input_engine"></a> [engine](#input_engine) | Oracle engine edition — oracle-ee, oracle-ee-cdb, oracle-se2, oracle-se2-cdb | `string` | `"oracle-ee"` | no |
| <a name="input_engine_version"></a> [engine_version](#input_engine_version) | Oracle engine version | `string` | `"19.0.0.0.ru-2024-04.rur-2024-04.r1"` | no |
| <a name="input_instance_class"></a> [instance_class](#input_instance_class) | RDS instance class | `string` | `"db.m5.large"` | no |
| <a name="input_kms_key_id"></a> [kms_key_id](#input_kms_key_id) | KMS key ARN for storage encryption | `string` | `null` | no |
| <a name="input_license_model"></a> [license_model](#input_license_model) | License model — license-included or bring-your-own-license | `string` | `"bring-your-own-license"` | no |
| <a name="input_manage_master_user_password"></a> [manage_master_user_password](#input_manage_master_user_password) | Let RDS manage the master password in Secrets Manager | `bool` | `true` | no |
| <a name="input_max_allocated_storage"></a> [max_allocated_storage](#input_max_allocated_storage) | Maximum storage for autoscaling | `number` | `500` | no |
| <a name="input_monitoring_interval"></a> [monitoring_interval](#input_monitoring_interval) | Enhanced monitoring interval in seconds | `number` | `60` | no |
| <a name="input_multi_az"></a> [multi_az](#input_multi_az) | Enable Multi-AZ | `bool` | `true` | no |
| <a name="input_option_group_name"></a> [option_group_name](#input_option_group_name) | Custom option group name (optional) | `string` | `null` | no |
| <a name="input_parameters"></a> [parameters](#input_parameters) | Map of DB parameter names to values | `map(string)` | `{}` | no |
| <a name="input_skip_final_snapshot"></a> [skip_final_snapshot](#input_skip_final_snapshot) | Skip final snapshot on deletion | `bool` | `false` | no |
| <a name="input_tags"></a> [tags](#input_tags) | Resource tags to apply to all resources | `map(string)` | `{}` | no |
| <a name="input_username"></a> [username](#input_username) | Master username | `string` | `"admin"` | no |

## Outputs

| Name | Description |
| ---- | ----------- |
| <a name="output_address"></a> [address](#output_address) | RDS instance hostname |
| <a name="output_arn"></a> [arn](#output_arn) | RDS instance ARN |
| <a name="output_endpoint"></a> [endpoint](#output_endpoint) | RDS instance connection endpoint |
| <a name="output_id"></a> [id](#output_id) | RDS instance identifier |
| <a name="output_master_user_secret_arn"></a> [master_user_secret_arn](#output_master_user_secret_arn) | Secrets Manager secret ARN for master password |
| <a name="output_port"></a> [port](#output_port) | RDS listener port |
<!-- END_TF_DOCS — DO NOT EDIT ABOVE THIS LINE -->
