Skip to content

aws_dms_replication_task: InvalidParameterValueException: Invalid CdcStartPosition format  #23319

Closed
@oirtemed

Description

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

 Terraform v0.14.10
+ provider registry.terraform.io/hashicorp/aws v3.64.0

Affected Resource(s)

  • aws_dms_replication_task

Terraform Configuration Files

resource "aws_dms_replication_task" "cdc_user" {
  replication_task_id       = "cdc-user"
  source_endpoint_arn       = aws_dms_endpoint.dc.endpoint_arn
  target_endpoint_arn       = aws_dms_endpoint.aws.endpoint_arn
  replication_instance_arn  = aws_dms_replication_instance.db.replication_instance_arn
  migration_type            = "cdc"
  table_mappings            = jsonencode(jsondecode(file("${path.module}/files/cdc-user_table_mappings.json")))
  replication_task_settings = jsonencode(jsondecode(file("${path.module}/files/cdc-user_task_settings.json")))
}

Debug Output

Panic Output

Expected Behavior

After upgrading the AWS provider from v3.58.0 to v3.64.0 Terraform should have maintained the existing cdc_start_position value for the replication task instead of setting that to null.

Actual Behavior

terraform plan output

   # aws_dms_replication_task.cdc_user will be updated in-place
   ~ resource "aws_dms_replication_task" "cdc_user" {
       - cdc_start_position        = "2021-12-14T12:15:05" -> null
         id                        = "cdc-user"
       ~ replication_task_settings = jsonencode(
           ~ {
               - TTSettings                          = {
                   - EnableTT         = false
                   - TTRecordSettings = null
                   - TTS3Settings     = null
                 } -> null
                 # (13 unchanged elements hidden)
             }
         )
         tags                      = {}
         # (8 unchanged attributes hidden)
     }

terraform apply fails with the error below


Error: InvalidParameterValueException: Invalid CdcStartPosition format
	status code: 400, request id: 35cc8d70-1267-4326-babd-f8b3367303fd

  on main.tf line 385, in resource "aws_dms_replication_task" "cdc_user":
385: resource "aws_dms_replication_task" "cdc_user" {

Steps to Reproduce

  1. terraform apply
  2. upgrade provider from v3.58.0 to v3.64.0
  3. terraform apply

Important Factoids

Probably the task has been stopped/resumed after the task was created by terraform and no changes were detected in the plans since the option was not supported until v3.62.0.

References

Metadata

Assignees

No one assigned

    Labels

    bugAddresses a defect in current functionality.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions