diff --git a/README.md b/README.md index ba10e32..ed9599d 100644 --- a/README.md +++ b/README.md @@ -303,14 +303,14 @@ Examples codified under the [`examples`](https://github.com/terraform-aws-module | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.0 | +| [aws](#requirement\_aws) | >= 5.31 | | [time](#requirement\_time) | >= 0.9 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.0 | +| [aws](#provider\_aws) | >= 5.31 | | [time](#provider\_time) | >= 0.9 | ## Modules @@ -385,6 +385,7 @@ No modules. | [repl\_instance\_id](#input\_repl\_instance\_id) | The replication instance identifier. This parameter is stored as a lowercase string | `string` | `null` | no | | [repl\_instance\_kms\_key\_arn](#input\_repl\_instance\_kms\_key\_arn) | The Amazon Resource Name (ARN) for the KMS key that will be used to encrypt the connection parameters | `string` | `null` | no | | [repl\_instance\_multi\_az](#input\_repl\_instance\_multi\_az) | Specifies if the replication instance is a multi-az deployment. You cannot set the `availability_zone` parameter if the `multi_az` parameter is set to `true` | `bool` | `null` | no | +| [repl\_instance\_network\_type](#input\_repl\_instance\_network\_type) | The type of IP address protocol used by a replication instance. Valid values: IPV4, DUAL | `string` | `null` | no | | [repl\_instance\_preferred\_maintenance\_window](#input\_repl\_instance\_preferred\_maintenance\_window) | The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC) | `string` | `null` | no | | [repl\_instance\_publicly\_accessible](#input\_repl\_instance\_publicly\_accessible) | Specifies the accessibility options for the replication instance | `bool` | `null` | no | | [repl\_instance\_subnet\_group\_id](#input\_repl\_instance\_subnet\_group\_id) | An existing subnet group to associate with the replication instance | `string` | `null` | no | diff --git a/examples/complete/README.md b/examples/complete/README.md index e5fd788..3726f08 100644 --- a/examples/complete/README.md +++ b/examples/complete/README.md @@ -28,14 +28,14 @@ Note that this example may create resources which will incur monetary charges on | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | >= 5.0 | +| [aws](#requirement\_aws) | >= 5.31 | | [random](#requirement\_random) | >= 3.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 5.0 | +| [aws](#provider\_aws) | >= 5.31 | ## Modules diff --git a/examples/complete/main.tf b/examples/complete/main.tf index ed0f212..8f801cc 100644 --- a/examples/complete/main.tf +++ b/examples/complete/main.tf @@ -134,6 +134,12 @@ module "dms_aurora_postgresql_aurora_mysql" { extra_connection_attributes = "heartbeatFrequency=1;secretsManagerEndpointOverride=${module.vpc_endpoints.endpoints["secretsmanager"]["dns_entry"][0]["dns_name"]}" secrets_manager_arn = module.secrets_manager_postgresql.secret_arn + postgres_settings = { + capture_ddls = false + heartbeat_enable = true + heartbeat_frequency = 1 + } + tags = { EndpointType = "postgresql-source" } } diff --git a/examples/complete/versions.tf b/examples/complete/versions.tf index d7b00bc..7c45939 100644 --- a/examples/complete/versions.tf +++ b/examples/complete/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.0" + version = ">= 5.31" } random = { source = "hashicorp/random" diff --git a/main.tf b/main.tf index cc707e5..452f970 100644 --- a/main.tf +++ b/main.tf @@ -149,6 +149,7 @@ resource "aws_dms_replication_instance" "this" { engine_version = var.repl_instance_engine_version kms_key_arn = var.repl_instance_kms_key_arn multi_az = var.repl_instance_multi_az + network_type = var.repl_instance_network_type preferred_maintenance_window = var.repl_instance_preferred_maintenance_window publicly_accessible = var.repl_instance_publicly_accessible replication_instance_class = var.repl_instance_class @@ -186,6 +187,7 @@ resource "aws_dms_endpoint" "this" { error_retry_duration = try(elasticsearch_settings.value.error_retry_duration, null) full_load_error_percentage = try(elasticsearch_settings.value.full_load_error_percentage, null) service_access_role_arn = lookup(elasticsearch_settings.value, "service_access_role_arn", aws_iam_role.access[0].arn) + use_new_mapping_type = try(elasticsearch_settings.value.use_new_mapping_type, null) } } @@ -253,8 +255,32 @@ resource "aws_dms_endpoint" "this" { } } - password = lookup(each.value, "password", null) - port = try(each.value.port, null) + password = lookup(each.value, "password", null) + pause_replication_tasks = try(each.value.pause_replication_tasks, null) + port = try(each.value.port, null) + + # https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.PostgreSQL.html + dynamic "postgres_settings" { + for_each = length(lookup(each.value, "postgres_settings", [])) > 0 ? [each.value.postgres_settings] : [] + content { + after_connect_script = try(postgres_settings.value.after_connect_script, null) + babelfish_database_name = try(postgres_settings.value.babelfish_database_name, null) + capture_ddls = try(postgres_settings.value.capture_ddls, null) + database_mode = try(postgres_settings.value.database_mode, null) + ddl_artifacts_schema = try(postgres_settings.value.ddl_artifacts_schema, null) + execute_timeout = try(postgres_settings.value.execute_timeout, null) + fail_tasks_on_lob_truncation = try(postgres_settings.value.fail_tasks_on_lob_truncation, null) + heartbeat_enable = try(postgres_settings.value.heartbeat_enable, null) + heartbeat_frequency = try(postgres_settings.value.heartbeat_frequency, null) + heartbeat_schema = try(postgres_settings.value.heartbeat_schema, null) + map_boolean_as_boolean = try(postgres_settings.value.map_boolean_as_boolean, null) + map_jsonb_as_clob = try(postgres_settings.value.map_jsonb_as_clob, null) + map_long_varchar_as = try(postgres_settings.value.map_long_varchar_as, null) + max_file_size = try(postgres_settings.value.max_file_size, null) + plugin_name = try(postgres_settings.value.plugin_name, null) + slot_name = try(postgres_settings.value.slot_name, null) + } + } dynamic "redis_settings" { for_each = length(lookup(each.value, "redis_settings", [])) > 0 ? [each.value.redis_settings] : [] @@ -335,6 +361,7 @@ resource "aws_dms_s3_endpoint" "this" { encryption_mode = try(each.value.encryption_mode, null) expected_bucket_owner = try(each.value.expected_bucket_owner, null) external_table_definition = try(each.value.external_table_definition, null) + glue_catalog_generation = try(each.value.glue_catalog_generation, null) ignore_header_rows = try(each.value.ignore_header_rows, null) include_op_for_full_load = try(each.value.include_op_for_full_load, null) max_file_size = try(each.value.max_file_size, null) diff --git a/variables.tf b/variables.tf index 5a48c1a..d020262 100644 --- a/variables.tf +++ b/variables.tf @@ -126,6 +126,12 @@ variable "repl_instance_multi_az" { default = null } +variable "repl_instance_network_type" { + description = "The type of IP address protocol used by a replication instance. Valid values: IPV4, DUAL" + type = string + default = null +} + variable "repl_instance_preferred_maintenance_window" { description = "The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC)" type = string diff --git a/versions.tf b/versions.tf index 497d5ab..32ed5b5 100644 --- a/versions.tf +++ b/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 5.0" + version = ">= 5.31" } time = { source = "hashicorp/time"