Skip to content

Commit 9dd4bf1

Browse files
authored
feat: DMS Endpoint postgres_settings (#54)
1 parent 615dc66 commit 9dd4bf1

File tree

7 files changed

+48
-8
lines changed

7 files changed

+48
-8
lines changed

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -303,14 +303,14 @@ Examples codified under the [`examples`](https://github.com/terraform-aws-module
303303
| Name | Version |
304304
|------|---------|
305305
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
306-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.0 |
306+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.31 |
307307
| <a name="requirement_time"></a> [time](#requirement\_time) | >= 0.9 |
308308

309309
## Providers
310310

311311
| Name | Version |
312312
|------|---------|
313-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.0 |
313+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.31 |
314314
| <a name="provider_time"></a> [time](#provider\_time) | >= 0.9 |
315315

316316
## Modules
@@ -385,6 +385,7 @@ No modules.
385385
| <a name="input_repl_instance_id"></a> [repl\_instance\_id](#input\_repl\_instance\_id) | The replication instance identifier. This parameter is stored as a lowercase string | `string` | `null` | no |
386386
| <a name="input_repl_instance_kms_key_arn"></a> [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 |
387387
| <a name="input_repl_instance_multi_az"></a> [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 |
388+
| <a name="input_repl_instance_network_type"></a> [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 |
388389
| <a name="input_repl_instance_preferred_maintenance_window"></a> [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 |
389390
| <a name="input_repl_instance_publicly_accessible"></a> [repl\_instance\_publicly\_accessible](#input\_repl\_instance\_publicly\_accessible) | Specifies the accessibility options for the replication instance | `bool` | `null` | no |
390391
| <a name="input_repl_instance_subnet_group_id"></a> [repl\_instance\_subnet\_group\_id](#input\_repl\_instance\_subnet\_group\_id) | An existing subnet group to associate with the replication instance | `string` | `null` | no |

examples/complete/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ Note that this example may create resources which will incur monetary charges on
2828
| Name | Version |
2929
|------|---------|
3030
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
31-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.0 |
31+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.31 |
3232
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 3.0 |
3333

3434
## Providers
3535

3636
| Name | Version |
3737
|------|---------|
38-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.0 |
38+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.31 |
3939

4040
## Modules
4141

examples/complete/main.tf

+6
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,12 @@ module "dms_aurora_postgresql_aurora_mysql" {
134134
extra_connection_attributes = "heartbeatFrequency=1;secretsManagerEndpointOverride=${module.vpc_endpoints.endpoints["secretsmanager"]["dns_entry"][0]["dns_name"]}"
135135
secrets_manager_arn = module.secrets_manager_postgresql.secret_arn
136136

137+
postgres_settings = {
138+
capture_ddls = false
139+
heartbeat_enable = true
140+
heartbeat_frequency = 1
141+
}
142+
137143
tags = { EndpointType = "postgresql-source" }
138144
}
139145

examples/complete/versions.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.0"
7+
version = ">= 5.31"
88
}
99
random = {
1010
source = "hashicorp/random"

main.tf

+29-2
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ resource "aws_dms_replication_instance" "this" {
149149
engine_version = var.repl_instance_engine_version
150150
kms_key_arn = var.repl_instance_kms_key_arn
151151
multi_az = var.repl_instance_multi_az
152+
network_type = var.repl_instance_network_type
152153
preferred_maintenance_window = var.repl_instance_preferred_maintenance_window
153154
publicly_accessible = var.repl_instance_publicly_accessible
154155
replication_instance_class = var.repl_instance_class
@@ -186,6 +187,7 @@ resource "aws_dms_endpoint" "this" {
186187
error_retry_duration = try(elasticsearch_settings.value.error_retry_duration, null)
187188
full_load_error_percentage = try(elasticsearch_settings.value.full_load_error_percentage, null)
188189
service_access_role_arn = lookup(elasticsearch_settings.value, "service_access_role_arn", aws_iam_role.access[0].arn)
190+
use_new_mapping_type = try(elasticsearch_settings.value.use_new_mapping_type, null)
189191
}
190192
}
191193

@@ -253,8 +255,32 @@ resource "aws_dms_endpoint" "this" {
253255
}
254256
}
255257

256-
password = lookup(each.value, "password", null)
257-
port = try(each.value.port, null)
258+
password = lookup(each.value, "password", null)
259+
pause_replication_tasks = try(each.value.pause_replication_tasks, null)
260+
port = try(each.value.port, null)
261+
262+
# https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.PostgreSQL.html
263+
dynamic "postgres_settings" {
264+
for_each = length(lookup(each.value, "postgres_settings", [])) > 0 ? [each.value.postgres_settings] : []
265+
content {
266+
after_connect_script = try(postgres_settings.value.after_connect_script, null)
267+
babelfish_database_name = try(postgres_settings.value.babelfish_database_name, null)
268+
capture_ddls = try(postgres_settings.value.capture_ddls, null)
269+
database_mode = try(postgres_settings.value.database_mode, null)
270+
ddl_artifacts_schema = try(postgres_settings.value.ddl_artifacts_schema, null)
271+
execute_timeout = try(postgres_settings.value.execute_timeout, null)
272+
fail_tasks_on_lob_truncation = try(postgres_settings.value.fail_tasks_on_lob_truncation, null)
273+
heartbeat_enable = try(postgres_settings.value.heartbeat_enable, null)
274+
heartbeat_frequency = try(postgres_settings.value.heartbeat_frequency, null)
275+
heartbeat_schema = try(postgres_settings.value.heartbeat_schema, null)
276+
map_boolean_as_boolean = try(postgres_settings.value.map_boolean_as_boolean, null)
277+
map_jsonb_as_clob = try(postgres_settings.value.map_jsonb_as_clob, null)
278+
map_long_varchar_as = try(postgres_settings.value.map_long_varchar_as, null)
279+
max_file_size = try(postgres_settings.value.max_file_size, null)
280+
plugin_name = try(postgres_settings.value.plugin_name, null)
281+
slot_name = try(postgres_settings.value.slot_name, null)
282+
}
283+
}
258284

259285
dynamic "redis_settings" {
260286
for_each = length(lookup(each.value, "redis_settings", [])) > 0 ? [each.value.redis_settings] : []
@@ -335,6 +361,7 @@ resource "aws_dms_s3_endpoint" "this" {
335361
encryption_mode = try(each.value.encryption_mode, null)
336362
expected_bucket_owner = try(each.value.expected_bucket_owner, null)
337363
external_table_definition = try(each.value.external_table_definition, null)
364+
glue_catalog_generation = try(each.value.glue_catalog_generation, null)
338365
ignore_header_rows = try(each.value.ignore_header_rows, null)
339366
include_op_for_full_load = try(each.value.include_op_for_full_load, null)
340367
max_file_size = try(each.value.max_file_size, null)

variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,12 @@ variable "repl_instance_multi_az" {
126126
default = null
127127
}
128128

129+
variable "repl_instance_network_type" {
130+
description = "The type of IP address protocol used by a replication instance. Valid values: IPV4, DUAL"
131+
type = string
132+
default = null
133+
}
134+
129135
variable "repl_instance_preferred_maintenance_window" {
130136
description = "The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC)"
131137
type = string

versions.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.0"
7+
version = ">= 5.31"
88
}
99
time = {
1010
source = "hashicorp/time"

0 commit comments

Comments
 (0)