Skip to content

intel/terraform-intel-aws-mariadb

Intel Logo

Intel® Optimized Cloud Modules for Terraform

© Copyright 2024, Intel Corporation

AWS RDS MariaDB module

Configuration in this directory creates an Amazon RDS instance for MariaDB. The instance is created on an Intel Icelake instance M6i.xlarge by default. The instance is pre-configured with parameters within the database parameter group that is optimized for Intel architecture. The goal of this module is to get you started with a database configured to run best on Intel architecture.

As you configure your application's environment, choose the configurations for your infrastructure that matches your application's requirements.

The MariaDB Optimizations were based off Intel Xeon Tuning guides

Usage

See examples folder for complete examples.

By default, you will only have to pass three variables

db_password
rds_identifier
vpc_id

variables.tf

variable "db_password" {
  description = "Password for the master database user."
  type        = string
  sensitive   = true
}

main.tf

module "optimized-mariadb-server" {
  source         = "intel/aws-mariadb/intel"
  db_password    = var.db_password
  rds_identifier = "<NAME-FOR-RDS-INSTANCE>"
  vpc_id         = "<YOUR-VPC-ID>"
  
}

Run terraform

export TF_VAR_db_password ='<USE_A_STRONG_PASSWORD>'

terraform init  
terraform plan
terraform apply

Considerations

  • Check in the variables.tf file for the region where this database instance will be created. It is defaulted to run in us-west-1 region within AWS. If you want to run it within any other region, make changes accordingly within the Terraform code

  • Check the variables.tf file for incoming ports allowed to connect to the database instance. The variable name is ingress_cidr_blocks. Currently it is defaulted to be open to the world like 0.0.0.0/0. Before runing the code, configure it based on specific security policies and requirements within the environment it is being implemented

  • Check if you getting errors while running this Terraform code due to AWS defined soft limits or hard limits within your AWS account. Please work with your AWS support team to resolve limit constraints

  • Using HashiCorp Modules alongside green-blue deployment allows for a secure and efficient deployment process. The modules can be easily integrated into both the active and inactive environments, ensuring consistency across both environments.

    • Instance - If you apply the instances will shut down immediately and restart, creating service interruption.
    • Platform - If you apply, it will wait for the next maintenance window to change the instance & configuration. You can force apply with additional TF code.

Requirements

Name Version
terraform >=1.3.0
aws ~> 4.36.0
random ~>3.4.3

Providers

Name Version
aws 4.36.1
random 3.4.3

Modules

No modules.

Resources

Name Type
aws_db_instance.rds resource
aws_db_parameter_group.rds resource
aws_db_subnet_group.rds resource
aws_security_group.rds resource
random_id.rid resource
aws_subnets.vpc_subnets data source

Inputs

Name Description Type Default Required
auto_major_version_upgrades Flag that specifices if major version upgrades are allowed. Changing this parameter does not result in an outage and the change is asynchronously applied as soon as possible. bool false no
auto_minor_version_upgrades Flag that specifies if minor engine upgrades will be applied automatically to the DB instance during the maintenance window. bool true no
availability_zone Availability zone where the RDS instance will be instantiated. string null no
aws_database_instance_identifier Identifier for the AWS database instance. string "mysql" no
aws_security_group_name security group name for the rds string "mysql_rds" no
create_security_group Flag that allows for the creation of a security group that allows access to the instance. Please use this for non-production use cases only. bool false no
create_subnet_group Flag that allows for the creation of a subnet group that allows public access. bool false no
db_allocated_storage Allocated storage for AWS database instance. number 200 no
db_apply_immediately Flag that specifies whether any database modifications are applied immediately, or during the next maintenance window. bool false no
db_automated_backup_arn The ARN of the automated backup from which to restore. Required if source_db_instance_identifier or source_dbi_resource_id is not specified. string null no
db_backup_retention_period The days to retain backups for. Must be between 0 and 35. Must be greater than 0 if the database is used as a source for a Read Replica. number 7 no
db_backup_window The daily time range (in UTC) during which automated backups are created if they are enabled. Example: 09:46-10:16. Must not overlap with maintenance_window. string null no
db_ca_cert_identifier The identifier of the CA certificate for the DB instance. string null no
db_cloudwatch_logs_export Set of log types to enable for exporting to CloudWatch logs. If omitted, no logs will be exported. list(string) [] no
db_custom_iam_profile (The instance profile associated with the underlying Amazon EC2 instance of an RDS Custom DB instance. string null no
db_deletion_protection Flag that specifies whether the DB instance is protected from deletion. bool false no
db_domain The ID of the Directory Service Active Directory domain to create the instance in. string null no
db_domain_iam_role (Required if db_domain is provided) The name of the IAM role to be used when making API calls to the Directory Service. string null no
db_encryption Flag that specifies whether the DB instance is encrypted. bool true no
db_engine Database engine version for AWS database instance. string "mysql" no
db_engine_version Database engine version for AWS database instance. string "8.0" no
db_iam_authentication Flag that specifies whether mappings of AWS Identity and Access Management (IAM) accounts to database accounts is enabled. bool false no
db_iops The amount of provisioned IOPS. Setting this implies a storage_type of io1. number 10000 no
db_maintenance_window The window to perform maintenance in. Syntax: ddd:hh24:mi-ddd:hh24:mi string null no
db_max_allocated_storage When configured, the upper limit to which Amazon RDS can automatically scale the storage of the DB instance. Configuring this will automatically ignore differences to allocated_storage. Must be greater than or equal to allocated_storage or 0 to disable Storage Autoscaling. number 10000 no
db_monitoring_interval The interval, in seconds, between points when Enhanced Monitoring metrics are collected for the DB instance string 0 no
db_monitoring_role_arn The ARN for the IAM role that permits RDS to send enhanced monitoring metrics to CloudWatch Logs string null no
db_name Name of the database that will be created on the RDS instance. If this is specified then a database will be created as a part of the instance provisioning process. string null no
db_option_group Option group name to associate with the database instance. string null no
db_parameter_group_family Family identifier for the RDS database parameter group. string "mysql8.0" no
db_parameter_group_name Name for the RDS database parameter group. string "mysql" no
db_parameters Intel Cloud optimizations for Xeon processors
object({
mysql = object({
table_open_cache = optional(object({
value = optional(string, "8000")
apply_method = optional(string, "immediate")
}))
table_open_cache_instances = optional(object({
value = optional(string, "16")
apply_method = optional(string, "pending-reboot")
}))
max_connections = optional(object({
value = optional(string, "4000")
apply_method = optional(string, "immediate")
}))
back_log = optional(object({
value = optional(string, "1500")
apply_method = optional(string, "pending-reboot")
}))
default_password_lifetime = optional(object({
value = optional(string, "0")
apply_method = optional(string, "pending-reboot")
}))
performance_schema = optional(object({
value = optional(string, "0")
apply_method = optional(string, "pending-reboot")
}))
max_prepared_stmt_count = optional(object({
value = optional(string, "128000")
apply_method = optional(string, "immediate")
}))
character_set_server = optional(object({
value = optional(string, "latin1")
apply_method = optional(string, "immediate")
}))
collation_server = optional(object({
value = optional(string, "latin1_swedish_ci")
apply_method = optional(string, "immediate")
}))
transaction_isolation = optional(object({
value = optional(string, "REPEATABLE-READ")
apply_method = optional(string, "immediate")
}))
innodb_log_file_size = optional(object({
value = optional(string, 1024 * 1024 * 1024)
apply_method = optional(string, "pending-reboot")
}))
innodb_open_files = optional(object({
value = optional(string, "4000")
apply_method = optional(string, "pending-reboot")
}))
innodb_file_per_table = optional(object({
value = optional(string, "1")
apply_method = optional(string, "pending-reboot")
}))
innodb_buffer_pool_instances = optional(object({
value = optional(string, "16")
apply_method = optional(string, "pending-reboot")
}))
innodb_buffer_pool_size = optional(object({
value = optional(string, "64424509440") # 60 Gigabytes #Calculator https://convertlive.com/u/convert/gigabytes/to/bytes
apply_method = optional(string, "pending-reboot")
}))
innodb_log_buffer_size = optional(object({
value = optional(string, "67108864")
apply_method = optional(string, "pending-reboot")
}))
innodb_thread_concurrency = optional(object({
value = optional(string, "0")
apply_method = optional(string, "immediate")
}))
innodb_flush_log_at_trx_commit = optional(object({
value = optional(string, "0")
apply_method = optional(string, "immediate")
}))
innodb_max_dirty_pages_pct = optional(object({
value = optional(string, "90")
apply_method = optional(string, "immediate")
}))
innodb_max_dirty_pages_pct_lwm = optional(object({
value = optional(string, "10")
apply_method = optional(string, "immediate")
}))
join_buffer_size = optional(object({
value = optional(string, 32 * 1024)
apply_method = optional(string, "immediate")
}))
sort_buffer_size = optional(object({
value = optional(string, 32 * 1024)
apply_method = optional(string, "immediate")
}))
innodb_use_native_aio = optional(object({
value = optional(string, "1")
apply_method = optional(string, "pending-reboot")
}))
innodb_stats_persistent = optional(object({
value = optional(string, "ON")
apply_method = optional(string, "immediate")
}))
innodb_spin_wait_delay = optional(object({
value = optional(string, "6")
apply_method = optional(string, "immediate")
}))
innodb_max_purge_lag_delay = optional(object({
value = optional(string, "300000")
apply_method = optional(string, "immediate")
}))
innodb_max_purge_lag = optional(object({
value = optional(string, "0")
apply_method = optional(string, "immediate")
}))
innodb_checksum_algorithm = optional(object({
value = optional(string, "none")
apply_method = optional(string, "immediate")
}))
innodb_io_capacity = optional(object({
value = optional(string, "4000")
apply_method = optional(string, "immediate")
}))
innodb_io_capacity_max = optional(object({
value = optional(string, "20000")
apply_method = optional(string, "immediate")
}))
innodb_lru_scan_depth = optional(object({
value = optional(string, "9000")
apply_method = optional(string, "immediate")
}))
innodb_change_buffering = optional(object({
value = optional(string, "none")
apply_method = optional(string, "immediate")
}))
innodb_page_cleaners = optional(object({
value = optional(string, "4")
apply_method = optional(string, "pending-reboot")
}))
innodb_undo_log_truncate = optional(object({
value = optional(string, "0")
apply_method = optional(string, "pending-reboot")
}))
innodb_adaptive_flushing = optional(object({
value = optional(string, "1")
apply_method = optional(string, "immediate")
}))
innodb_flush_neighbors = optional(object({
value = optional(string, "0")
apply_method = optional(string, "immediate")
}))
innodb_read_io_threads = optional(object({
value = optional(string, "16")
apply_method = optional(string, "pending-reboot")
}))
innodb_write_io_threads = optional(object({
value = optional(string, "16")
apply_method = optional(string, "pending-reboot")
}))
innodb_purge_threads = optional(object({
value = optional(string, "4")
apply_method = optional(string, "pending-reboot")
}))
innodb_adaptive_hash_index = optional(object({
value = optional(string, "0")
apply_method = optional(string, "immediate")
}))
})
})
{
"mysql": {
"back_log": {},
"character_set_server": {},
"collation_server": {},
"default_password_lifetime": {},
"innodb_adaptive_flushing": {},
"innodb_adaptive_hash_index": {},
"innodb_buffer_pool_instances": {},
"innodb_buffer_pool_size": {},
"innodb_change_buffering": {},
"innodb_checksum_algorithm": {},
"innodb_file_per_table": {},
"innodb_flush_log_at_trx_commit": {},
"innodb_flush_neighbors": {},
"innodb_io_capacity": {},
"innodb_io_capacity_max": {},
"innodb_log_buffer_size": {},
"innodb_log_file_size": {},
"innodb_lru_scan_depth": {},
"innodb_max_dirty_pages_pct": {},
"innodb_max_dirty_pages_pct_lwm": {},
"innodb_max_purge_lag": {},
"innodb_max_purge_lag_delay": {},
"innodb_open_files": {},
"innodb_page_cleaners": {},
"innodb_purge_threads": {},
"innodb_read_io_threads": {},
"innodb_spin_wait_delay": {},
"innodb_stats_persistent": {},
"innodb_thread_concurrency": {},
"innodb_undo_log_truncate": {},
"innodb_use_native_aio": {},
"innodb_write_io_threads": {},
"join_buffer_size": {},
"max_connections": {},
"max_prepared_stmt_count": {},
"performance_schema": {},
"sort_buffer_size": {},
"table_open_cache": {},
"table_open_cache_instances": {},
"transaction_isolation": {}
}
}
no
db_password Password for the master database user. string n/a yes
db_performance_insights Flag that specifies whether Performance Insights are enabled. bool false no
db_performance_insights_kms_key_id The ARN for the KMS key to encrypt Performance Insights data. string null no
db_performance_retention_period Amount of time in days to retain Performance Insights data.Valid values are 7, 731 (2 years) or a multiple of 31. string null no
db_port The port on which the DB accepts connections. number null no
db_publicly_accessible Flag to indicate whether the database will be publicly accessible. bool false no
db_replicate_source_db Specifies that this resource is a Replicate database, and to use this value as the source database. This correlates to the identifier of another Amazon RDS Database to replicate (if replicating within a single region) or ARN of the Amazon RDS Database to replicate (if replicating cross-region). Note that if you are creating a cross-region replica of an encrypted database you will also need to specify a kms_key_id. string null no
db_restore_time The date and time to restore from. Value must be a time in Universal Coordinated Time (UTC) format and must be before the latest restorable time for the DB instance. string null no
db_snapshot_identifier Specifies whether or not to create this database from a snapshot. This correlates to the snapshot ID you'd find in the RDS console. string null no
db_source_db_instance_id The identifier of the source DB instance from which to restore. Must match the identifier of an existing DB instance. Required if source_db_instance_automated_backups_arn or source_dbi_resource_id is not specified. string null no
db_source_dbi_resource_id The resource ID of the source DB instance from which to restore. Required if source_db_instance_identifier or source_db_instance_automated_backups_arn is not specified. string null no
db_storage_type The storage type that will be set on the instance. If db_iops is set then this will be set to io1 string "io1" no
db_subnet_group_name Database subnet group name. string "mysql" no
db_subnet_group_tag Tag for the database subnet group. map(string)
{
"Name": "mysql"
}
no
db_tags Map of tags to apply to the database instance. map(string) null no
db_timeouts Map of timeouts that can be adjusted when executing the module. This allows you to customize how long certain operations are allowed to take before being considered to have failed.
object({
create = optional(string, null)
delete = optional(string, null)
update = optional(string, null)
})
{
"db_timeouts": {}
}
no
db_use_latest_restore_time Flag that indicates whether the DB instance is restored from the latest backup time. bool null no
db_username Username for the master database user. string null no
egress_cidr_blocks Egress CIDR block for the RDS security group. list(string)
[
"0.0.0.0/0"
]
no
egress_from_port Starting egress port for the RDS security group. number 3306 no
egress_protocol Egress protocol for the port defined in the RDS security group. string "tcp" no
egress_to_port Ending egress port for the RDS security group. number 3306 no
final_snapshot_prefix The name which is prefixed to the final snapshot on database termination. string "mysql-snap-" no
ingress_cidr_blocks Ingress CIDR block for the RDS security group. list(string)
[
"0.0.0.0/0"
]
no
ingress_from_port Starting ingress port for the RDS security group. number 3306 no
ingress_protocol Ingress protocol for the port defined in the RDS security group. string "tcp" no
ingress_to_port Ending ingress port for the RDS security group. number 3306 no
instance_class Instance class that will be used by the RDS instance. string "db.m6i.2xlarge" no
kms_key_id The ARN for the KMS encryption key. If creating an encrypted replica, set this to the destination KMS ARN. string null no
multi_az Flag that specifies if the RDS instance is multi_az. bool true no
rds_identifier Name of the RDS instance that will be created. string n/a yes
rds_security_group_tag Map of tags for the RDS security group. map(string)
{
"Name": "mysql_rds"
}
no
security_group_ids List of existing AWS security groups that will be attached to the RDS instance. list(string) null no
skip_final_snapshot Flag to indicate whether a final snapshot will be skipped upon database termination. bool false no
vpc_id VPC ID within which the database resource will be created. string n/a yes

Outputs

Name Description
db_allocated_storage Storage that was allocated to the instance when it configured.
db_arn ARN of the database instance.
db_automated_backup_arn The ARN of the automated backup from which to restore.
db_backup_retention Number of configured backups to keep for the database instance.
db_backup_window Configured backup window for the database instance.
db_ca_cert_identifier The identifier of the CA certificate for the DB instance.
db_custom_iam_profile The instance profile associated with the underlying Amazon EC2 instance of an RDS Custom DB instance.
db_delete_automated_backups Flag that specifies if automated backups are deleted.
db_domain_iam_role The name of the IAM role to be used when making API calls to the Directory Service.
db_encryption Flag that indicates if storage encryption is enabled.
db_endpoint Connection endpoint for the database instance that has been created.
db_engine Database instance engine that was configured.
db_engine_version_actual Running engine version of the database (full version number)
db_final_snapshot_identifier Final snapshot identifier for the database instance.
db_hosted_zone_id Hosted zone ID for the database instance.
db_hostname Database instance hostname.
db_iam_auth_enabled Flag that specifies if iam authenticaiton is enabled on the database
db_instance_id RDS instance ID.
db_iops Database instance iops that was configured.
db_kms_key_id KMS key that is configured on the database instance if storage encryption is enabled.
db_latest_restore_time Latest available restorable time for the database instance.
db_maintenance_window Maintainence window for the database instance.
db_max_allocated_storage Maximum storage allocation that is configured on the database instance.
db_monitoring_interval Monitoring interval configuration.
db_name Name of the database that was created (if specified) during instance creation.
db_parameter_group Parameter group that was created
db_password Database instance master password.
db_performance_insights Flag that indiciates if Performance Insights is enabled.
db_performance_insights_kms_key_id ARN of the KMS key that Performance Insights is utilizing (if enabled).
db_performance_insights_retention_period Data retention period for Performance Insights (if enabled).
db_port Database instance port.
db_restore_time The date and time to restore from.
db_security_group Security Group that was created (if specified) during the run.
db_security_group_ids Security Group IDs that were associated with the database instance.
db_source_db_instance_id The identifier of the source DB instance from which to restore.
db_source_dbi_resource_id The resource ID of the source DB instance from which to restore.
db_status Status of the database instance that was created.
db_storage_type Storage type that is configured on the database instance.
db_subnet_group Name of the subnet group that is associated with the database instance.
db_username Database instance master username.
instance_class Instance class in use for the database instance that was created.

Requirements

Name Version
terraform >=1.3.0
aws ~> 5.31
random ~>3.4.3

Providers

Name Version
aws ~> 5.31
random ~>3.4.3

Modules

No modules.

Resources

Name Type
aws_db_instance.rds resource
aws_db_parameter_group.rds resource
aws_db_subnet_group.rds resource
aws_security_group.rds resource
random_id.rid resource
aws_subnets.vpc_subnets data source

Inputs

Name Description Type Default Required
auto_major_version_upgrades Flag that specifices if major version upgrades are allowed. Changing this parameter does not result in an outage and the change is asynchronously applied as soon as possible. bool false no
auto_minor_version_upgrades Flag that specifies if minor engine upgrades will be applied automatically to the DB instance during the maintenance window. bool true no
availability_zone Availability zone where the RDS instance will be instantiated. string null no
aws_security_group_name security group name for the rds string "mariadb_rds" no
create_security_group Flag that allows for the creation of a security group that allows access to the instance. Please use this for non-production use cases only. bool false no
create_subnet_group Flag that allows for the creation of a subnet group that allows public access. bool true no
db_allocated_storage Allocated storage for AWS database instance. number 200 no
db_apply_immediately Flag that specifies whether any database modifications are applied immediately, or during the next maintenance window. bool false no
db_automated_backup_arn The ARN of the automated backup from which to restore. Required if source_db_instance_identifier or source_dbi_resource_id is not specified. string null no
db_backup_retention_period The days to retain backups for. Must be between 0 and 35. Must be greater than 0 if the database is used as a source for a Read Replica. number 7 no
db_backup_window The daily time range (in UTC) during which automated backups are created if they are enabled. Example: 09:46-10:16. Must not overlap with maintenance_window. string null no
db_ca_cert_identifier The identifier of the CA certificate for the DB instance. string null no
db_cloudwatch_logs_export Set of log types to enable for exporting to CloudWatch logs. If omitted, no logs will be exported. list(string) [] no
db_custom_iam_profile (The instance profile associated with the underlying Amazon EC2 instance of an RDS Custom DB instance. string null no
db_deletion_protection Flag that specifies whether the DB instance is protected from deletion. bool false no
db_domain The ID of the Directory Service Active Directory domain to create the instance in. string null no
db_domain_iam_role (Required if db_domain is provided) The name of the IAM role to be used when making API calls to the Directory Service. string null no
db_encryption Flag that specifies whether the DB instance is encrypted. bool true no
db_engine Database engine version for AWS database instance. string "mariadb" no
db_engine_version Database engine version for AWS database instance. string "10.6" no
db_iam_authentication Flag that specifies whether mappings of AWS Identity and Access Management (IAM) accounts to database accounts is enabled. bool false no
db_iops The amount of provisioned IOPS. Setting this implies a storage_type of io1. number 10000 no
db_maintenance_window The window to perform maintenance in. Syntax: ddd:hh24:mi-ddd:hh24:mi string null no
db_max_allocated_storage When configured, the upper limit to which Amazon RDS can automatically scale the storage of the DB instance. Configuring this will automatically ignore differences to allocated_storage. Must be greater than or equal to allocated_storage or 0 to disable Storage Autoscaling. number 10000 no
db_monitoring_interval The interval, in seconds, between points when Enhanced Monitoring metrics are collected for the DB instance string 0 no
db_monitoring_role_arn The ARN for the IAM role that permits RDS to send enhanced monitoring metrics to CloudWatch Logs string null no
db_name Name of the database that will be created on the RDS instance. If this is specified then a database will be created as a part of the instance provisioning process. string null no
db_option_group Option group name to associate with the database instance. string null no
db_parameter_group_family Family identifier for the RDS database parameter group. string "mariadb10.6" no
db_parameter_group_name Name for the RDS database parameter group. string "mariadb" no
db_parameters Intel Cloud optimizations for Xeon processors
object({
mariadb = object({
table_open_cache = optional(object({
value = optional(string, "8000")
apply_method = optional(string, "immediate")
}))
table_open_cache_instances = optional(object({
value = optional(string, "16")
apply_method = optional(string, "pending-reboot")
}))
max_connections = optional(object({
value = optional(string, "4000")
apply_method = optional(string, "immediate")
}))
back_log = optional(object({
value = optional(string, "1500")
apply_method = optional(string, "pending-reboot")
}))
default_password_lifetime = optional(object({
value = optional(string, "0")
apply_method = optional(string, "pending-reboot")
}))
performance_schema = optional(object({
value = optional(string, "0")
apply_method = optional(string, "pending-reboot")
}))
max_prepared_stmt_count = optional(object({
value = optional(string, "128000")
apply_method = optional(string, "immediate")
}))
character_set_server = optional(object({
value = optional(string, "latin1")
apply_method = optional(string, "immediate")
}))
collation_server = optional(object({
value = optional(string, "latin1_swedish_ci")
apply_method = optional(string, "immediate")
}))
innodb_log_file_size = optional(object({
value = optional(string, 1024 * 1024 * 1024)
apply_method = optional(string, "pending-reboot")
}))
innodb_open_files = optional(object({
value = optional(string, "4000")
apply_method = optional(string, "pending-reboot")
}))
innodb_file_per_table = optional(object({
value = optional(string, "1")
apply_method = optional(string, "pending-reboot")
}))
innodb_buffer_pool_size = optional(object({
value = optional(string, "64424509440") # 60 Gigabytes #Calculator https://convertlive.com/u/convert/gigabytes/to/bytes
apply_method = optional(string, "pending-reboot")
}))
innodb_log_buffer_size = optional(object({
value = optional(string, "67108864")
apply_method = optional(string, "pending-reboot")
}))
innodb_flush_log_at_trx_commit = optional(object({
value = optional(string, "0")
apply_method = optional(string, "immediate")
}))
innodb_max_dirty_pages_pct = optional(object({
value = optional(string, "90")
apply_method = optional(string, "immediate")
}))
innodb_max_dirty_pages_pct_lwm = optional(object({
value = optional(string, "10")
apply_method = optional(string, "immediate")
}))
join_buffer_size = optional(object({
value = optional(string, 32 * 1024)
apply_method = optional(string, "immediate")
}))
sort_buffer_size = optional(object({
value = optional(string, 32 * 1024)
apply_method = optional(string, "immediate")
}))
innodb_use_native_aio = optional(object({
value = optional(string, "1")
apply_method = optional(string, "pending-reboot")
}))
innodb_stats_persistent = optional(object({
value = optional(string, "ON")
apply_method = optional(string, "immediate")
}))
innodb_spin_wait_delay = optional(object({
value = optional(string, "6")
apply_method = optional(string, "immediate")
}))
innodb_max_purge_lag_delay = optional(object({
value = optional(string, "300000")
apply_method = optional(string, "immediate")
}))
innodb_max_purge_lag = optional(object({
value = optional(string, "0")
apply_method = optional(string, "immediate")
}))
innodb_io_capacity = optional(object({
value = optional(string, "4000")
apply_method = optional(string, "immediate")
}))
innodb_io_capacity_max = optional(object({
value = optional(string, "20000")
apply_method = optional(string, "immediate")
}))
innodb_lru_scan_depth = optional(object({
value = optional(string, "9000")
apply_method = optional(string, "immediate")
}))
innodb_change_buffering = optional(object({
value = optional(string, "none")
apply_method = optional(string, "immediate")
}))
innodb_undo_log_truncate = optional(object({
value = optional(string, "0")
apply_method = optional(string, "pending-reboot")
}))
innodb_adaptive_flushing = optional(object({
value = optional(string, "1")
apply_method = optional(string, "immediate")
}))
innodb_flush_neighbors = optional(object({
value = optional(string, "0")
apply_method = optional(string, "immediate")
}))
innodb_read_io_threads = optional(object({
value = optional(string, "16")
apply_method = optional(string, "pending-reboot")
}))
innodb_write_io_threads = optional(object({
value = optional(string, "16")
apply_method = optional(string, "pending-reboot")
}))
innodb_purge_threads = optional(object({
value = optional(string, "4")
apply_method = optional(string, "pending-reboot")
}))
innodb_adaptive_hash_index = optional(object({
value = optional(string, "0")
apply_method = optional(string, "immediate")
}))
})
})
{
"mariadb": {
"back_log": {},
"character_set_server": {},
"collation_server": {},
"default_password_lifetime": {},
"innodb_adaptive_flushing": {},
"innodb_adaptive_hash_index": {},
"innodb_buffer_pool_size": {},
"innodb_change_buffering": {},
"innodb_file_per_table": {},
"innodb_flush_log_at_trx_commit": {},
"innodb_flush_neighbors": {},
"innodb_io_capacity": {},
"innodb_io_capacity_max": {},
"innodb_log_buffer_size": {},
"innodb_log_file_size": {},
"innodb_lru_scan_depth": {},
"innodb_max_dirty_pages_pct": {},
"innodb_max_dirty_pages_pct_lwm": {},
"innodb_max_purge_lag": {},
"innodb_max_purge_lag_delay": {},
"innodb_open_files": {},
"innodb_purge_threads": {},
"innodb_read_io_threads": {},
"innodb_spin_wait_delay": {},
"innodb_stats_persistent": {},
"innodb_undo_log_truncate": {},
"innodb_use_native_aio": {},
"innodb_write_io_threads": {},
"join_buffer_size": {},
"max_connections": {},
"max_prepared_stmt_count": {},
"performance_schema": {},
"sort_buffer_size": {},
"table_open_cache": {},
"table_open_cache_instances": {}
}
}
no
db_password Password for the master database user. string n/a yes
db_performance_insights Flag that specifies whether Performance Insights are enabled. bool false no
db_performance_insights_kms_key_id The ARN for the KMS key to encrypt Performance Insights data. string null no
db_performance_retention_period Amount of time in days to retain Performance Insights data.Valid values are 7, 731 (2 years) or a multiple of 31. string null no
db_port The port on which the DB accepts connections. number null no
db_publicly_accessible Flag to indicate whether the database will be publicly accessible. bool false no
db_replicate_source_db Specifies that this resource is a Replicate database, and to use this value as the source database. This correlates to the identifier of another Amazon RDS Database to replicate (if replicating within a single region) or ARN of the Amazon RDS Database to replicate (if replicating cross-region). Note that if you are creating a cross-region replica of an encrypted database you will also need to specify a kms_key_id. string null no
db_restore_time The date and time to restore from. Value must be a time in Universal Coordinated Time (UTC) format and must be before the latest restorable time for the DB instance. string null no
db_snapshot_identifier Specifies whether or not to create this database from a snapshot. This correlates to the snapshot ID you'd find in the RDS console. string null no
db_source_db_instance_id The identifier of the source DB instance from which to restore. Must match the identifier of an existing DB instance. Required if source_db_instance_automated_backups_arn or source_dbi_resource_id is not specified. string null no
db_source_dbi_resource_id The resource ID of the source DB instance from which to restore. Required if source_db_instance_identifier or source_db_instance_automated_backups_arn is not specified. string null no
db_storage_type The storage type that will be set on the instance. If db_iops is set then this will be set to io1 string "io1" no
db_subnet_group_name Database subnet group name. string null no
db_subnet_group_tag Tag for the database subnet group. map(string)
{
"Name": "mariadb"
}
no
db_tags Map of tags to apply to the database instance. map(string) null no
db_timeouts Map of timeouts that can be adjusted when executing the module. This allows you to customize how long certain operations are allowed to take before being considered to have failed.
object({
create = optional(string, null)
delete = optional(string, null)
update = optional(string, null)
})
{
"db_timeouts": {}
}
no
db_use_latest_restore_time Flag that indicates whether the DB instance is restored from the latest backup time. bool null no
db_username Username for the master database user. string null no
egress_cidr_blocks Egress CIDR block for the RDS security group. list(string)
[
"0.0.0.0/0"
]
no
egress_from_port Starting egress port for the RDS security group. number 3306 no
egress_protocol Egress protocol for the port defined in the RDS security group. string "tcp" no
egress_to_port Ending egress port for the RDS security group. number 3306 no
final_snapshot_prefix The name which is prefixed to the final snapshot on database termination. string "mariadb-snap-" no
ingress_cidr_blocks Ingress CIDR block for the RDS security group. list(string)
[
"0.0.0.0/0"
]
no
ingress_from_port Starting ingress port for the RDS security group. number 3306 no
ingress_protocol Ingress protocol for the port defined in the RDS security group. string "tcp" no
ingress_to_port Ending ingress port for the RDS security group. number 3306 no
instance_class Instance class that will be used by the RDS instance. string "db.m6i.2xlarge" no
kms_key_id The ARN for the KMS encryption key. If creating an encrypted replica, set this to the destination KMS ARN. string null no
multi_az Flag that specifies if the RDS instance is multi_az. bool true no
rds_identifier Name of the RDS instance that will be created. string n/a yes
rds_security_group_tag Map of tags for the RDS security group. map(string)
{
"Name": "mariadb_rds"
}
no
security_group_ids List of existing AWS security groups that will be attached to the RDS instance. list(string) null no
skip_final_snapshot Flag to indicate whether a final snapshot will be skipped upon database termination. bool false no
vpc_id VPC ID within which the database resource will be created. string n/a yes

Outputs

Name Description
db_allocated_storage Storage that was allocated to the instance when it configured.
db_arn ARN of the database instance.
db_automated_backup_arn The ARN of the automated backup from which to restore.
db_backup_retention Number of configured backups to keep for the database instance.
db_backup_window Configured backup window for the database instance.
db_ca_cert_identifier The identifier of the CA certificate for the DB instance.
db_custom_iam_profile The instance profile associated with the underlying Amazon EC2 instance of an RDS Custom DB instance.
db_delete_automated_backups Flag that specifies if automated backups are deleted.
db_domain_iam_role The name of the IAM role to be used when making API calls to the Directory Service.
db_encryption Flag that indicates if storage encryption is enabled.
db_endpoint Connection endpoint for the database instance that has been created.
db_engine Database instance engine that was configured.
db_engine_version_actual Running engine version of the database (full version number)
db_final_snapshot_identifier Final snapshot identifier for the database instance.
db_hosted_zone_id Hosted zone ID for the database instance.
db_hostname Database instance hostname.
db_iam_auth_enabled Flag that specifies if iam authenticaiton is enabled on the database
db_instance_id RDS instance ID.
db_iops Database instance iops that was configured.
db_kms_key_id KMS key that is configured on the database instance if storage encryption is enabled.
db_latest_restore_time Latest available restorable time for the database instance.
db_maintenance_window Maintainence window for the database instance.
db_max_allocated_storage Maximum storage allocation that is configured on the database instance.
db_monitoring_interval Monitoring interval configuration.
db_name Name of the database that was created (if specified) during instance creation.
db_parameter_group Parameter group that was created
db_password Database instance master password.
db_performance_insights Flag that indiciates if Performance Insights is enabled.
db_performance_insights_kms_key_id ARN of the KMS key that Performance Insights is utilizing (if enabled).
db_performance_insights_retention_period Data retention period for Performance Insights (if enabled).
db_port Database instance port.
db_restore_time The date and time to restore from.
db_security_group Security Group that was created (if specified) during the run.
db_security_group_ids Security Group IDs that were associated with the database instance.
db_source_db_instance_id The identifier of the source DB instance from which to restore.
db_source_dbi_resource_id The resource ID of the source DB instance from which to restore.
db_status Status of the database instance that was created.
db_storage_type Storage type that is configured on the database instance.
db_subnet_group Name of the subnet group that is associated with the database instance.
db_username Database instance master username.
instance_class Instance class in use for the database instance that was created.