Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: aws_dms_replication_config has persistent changes #35573

Closed
christyWtt opened this issue Jan 31, 2024 · 3 comments · Fixed by #36035
Closed

[Bug]: aws_dms_replication_config has persistent changes #35573

christyWtt opened this issue Jan 31, 2024 · 3 comments · Fixed by #36035
Assignees
Labels
bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/dms Issues and PRs that pertain to the dms service.
Milestone

Comments

@christyWtt
Copy link

Terraform Core Version

1.3.1

AWS Provider Version

5.34.0

Affected Resource(s)

aws_dms_replication_config

Expected Behavior

Apply config parameters consistently

Actual Behavior

It wants to remove the replication_settings and it is not configured by terraform. In my replication_settings, I just configure the "Logging" settings. However, the terraform plan show many changes of replication_settings.

I have reported issue #35493 and it said this bug is fixed in 5.32.0. However, this issue still exists in 5.34.0.

Relevant Error/Panic Output Snippet

# On plan:
# module.dms_replication_instance.aws_dms_replication_config.dms_cdc_serverless_replication will be updated in-place
  ~ resource "aws_dms_replication_config" "dms_cdc_serverless_replication" {
        id                            = "arn:aws:dms:us-east-1:192609132212:replication-config:devint-common-domain-cdc"
      ~ replication_settings          = jsonencode(
          ~ {
              - BeforeImageSettings                 = null -> null
              - ChangeProcessingDdlHandlingPolicy   = {
                  - HandleSourceTableAltered   = true
                  - HandleSourceTableDropped   = true
                  - HandleSourceTableTruncated = true
                } -> null
              - ChangeProcessingTuning              = {
                  - BatchApplyMemoryLimit         = 500
                  - BatchApplyPreserveTransaction = true
                  - BatchApplyTimeoutMax          = 30
                  - BatchApplyTimeoutMin          = 1
                  - BatchSplitSize                = 0
                  - CommitTimeout                 = 1
                  - MemoryKeepTime                = 60
                  - MemoryLimitTotal              = 1024
                  - MinTransactionSize            = 1000
                  - StatementCacheSize            = 50
                } -> null
              - CharacterSetSettings                = null -> null
              - ControlTablesSettings               = {
                  - CommitPositionTableEnabled    = false
                  - ControlSchema                 = ""
                  - FullLoadExceptionTableEnabled = false
                  - HistoryTableEnabled           = false
                  - HistoryTimeslotInMinutes      = 5
                  - StatusTableEnabled            = false
                  - SuspendedTablesTableEnabled   = false
                  - historyTimeslotInMinutes      = 5
                } -> null
              - ErrorBehavior                       = {
                  - ApplyErrorDeletePolicy                      = "IGNORE_RECORD"
                  - ApplyErrorEscalationCount                   = 0
                  - ApplyErrorEscalationPolicy                  = "LOG_ERROR"
                  - ApplyErrorFailOnTruncationDdl               = false
                  - ApplyErrorInsertPolicy                      = "LOG_ERROR"
                  - ApplyErrorUpdatePolicy                      = "LOG_ERROR"
                  - DataErrorEscalationCount                    = 0
                  - DataErrorEscalationPolicy                   = "SUSPEND_TABLE"
                  - DataErrorPolicy                             = "LOG_ERROR"
                  - DataTruncationErrorPolicy                   = "LOG_ERROR"
                  - EventErrorPolicy                            = "IGNORE"
                  - FailOnNoTablesCaptured                      = true
                  - FailOnTransactionConsistencyBreached        = false
                  - FullLoadIgnoreConflicts                     = true
                  - RecoverableErrorCount                       = -1
                  - RecoverableErrorInterval                    = 5
                  - RecoverableErrorStopRetryAfterThrottlingMax = true
                  - RecoverableErrorThrottling                  = true
                  - RecoverableErrorThrottlingMax               = 1800
                  - TableErrorEscalationCount                   = 0
                  - TableErrorEscalationPolicy                  = "STOP_TASK"
                  - TableErrorPolicy                            = "SUSPEND_TABLE"
                } -> null
              - FailTaskWhenCleanTaskResourceFailed = false -> null
              - FullLoadSettings                    = {
                  - CommitRate                      = 10000
                  - CreatePkAfterFullLoad           = false
                  - MaxFullLoadSubTasks             = 8
                  - StopTaskCachedChangesApplied    = false
                  - StopTaskCachedChangesNotApplied = false
                  - TargetTablePrepMode             = "DO_NOTHING"
                  - TransactionConsistencyTimeout   = 600
                } -> null
              ~ Logging                             = {
                  - CloudWatchLogGroup  = "dms-serverless-replication-devint-common-domain-cdc" -> null
                  - CloudWatchLogStream = "dms-serverless-serv-res-id-1706673342400-mt2" -> null
                  - EnableLogContext    = false -> null
                    # (2 unchanged elements hidden)
                }
              - LoopbackPreventionSettings          = null -> null
              - PostProcessingRules                 = null -> null
              - StreamBufferSettings                = {
                  - CtrlStreamBufferSizeInMB = 5
                  - StreamBufferCount        = 3
                  - StreamBufferSizeInMB     = 8
                } -> null
              - TTSettings                          = {
                  - EnableTT            = false
                  - FailTaskOnTTFailure = false
                  - TTRecordSettings    = null
                  - TTS3Settings        = null
                } -> null
              - TargetMetadata                      = {
                  - BatchApplyEnabled            = false
                  - FullLobMode                  = false
                  - InlineLobMaxSize             = 0
                  - LimitedSizeLobMode           = true
                  - LoadMaxFileSize              = 0
                  - LobChunkSize                 = 64
                  - LobMaxSize                   = 32
                  - ParallelApplyBufferSize      = 0
                  - ParallelApplyQueuesPerThread = 0
                  - ParallelApplyThreads         = 0
                  - ParallelLoadBufferSize       = 0
                  - ParallelLoadQueuesPerThread  = 0
                  - ParallelLoadThreads          = 0
                  - SupportLobs                  = true
                  - TargetSchema                 = ""
                  - TaskRecoveryTableEnabled     = false
                } -> null
            }
        )
        tags                          = {
            "Client"   = "ksc"
            "Domain"   = "common-domain"
            "Solution" = "indy"
            "Type"     = "cdc"
            "Use"      = "devint"
        }
        # (9 unchanged attributes hidden)
        # (1 unchanged block hidden)
    }

# On apply:
│ Error: modifying DMS Replication Config (arn:aws:dms:us-east-1:192609132212:replication-config:devint-holding-domain): InvalidParameterCombinationException: No modifications requested for replication config with arn, 'arn:aws:dms:us-east-1:192609132212:replication-config:devint-holding-domain'
│ 	status code: 400, request id: aa3f06d9-33a3-4237-93e3-2b7b046f49db
│ 
│   with module.dms_replication_instance.aws_dms_replication_config.dms_full_load_serverless_replication[5],
│   on ../../../modules/dms/replication/dms_serverless_replication.tf line 136, in resource "aws_dms_replication_config" "dms_full_load_serverless_replication":
│  136: resource "aws_dms_replication_config" "dms_full_load_serverless_replication" {

Terraform Configuration Files

# Create the DMS full load serverless replication
resource "aws_dms_replication_config" "dms_full_load_serverless_replication" {
  count = length(var.full_load_domain_list)

  # The maximum length of the replication name is 31. Use substr to make sure the name length is compliant.
  replication_config_identifier = replace(substr("${local.usage}-${var.full_load_domain_list[count.index].domain_name}",0,31), "/-$/", "")
  resource_identifier           = replace(substr("${local.usage}-${var.full_load_domain_list[count.index].domain_name}",0,31), "/-$/", "")
  replication_type              = "full-load"
  source_endpoint_arn           = var.source_endpoint_arn
  target_endpoint_arn           = aws_dms_s3_endpoint.full_load_target_endpoint[count.index].endpoint_arn
  table_mappings                = data.template_file.full_load_table_mapping[count.index].rendered
  replication_settings          = var.replication_settings

  compute_config {
    max_capacity_units           = var.full_load_max_capacity_units
    min_capacity_units           = var.full_load_min_capacity_units
    multi_az                     = var.multi_az
    availability_zone            = var.availability_zone
    preferred_maintenance_window = var.preferred_maintenance_window
    replication_subnet_group_id  = aws_dms_replication_subnet_group.dms_subnet_group.id
    vpc_security_group_ids       = [aws_security_group.replication_instance_sg.id]
  }

  tags = {
    Solution = var.context["solution"]
    Client   = var.context["client"]
    Use      = var.context["usage"]
    Domain   = var.full_load_domain_list[count.index].domain_name
    Type     = "full-load"
  }

  depends_on = [
    aws_iam_role_policy_attachment.dms-access-for-endpoint-AmazonDMSRedshiftS3Role,
    aws_iam_role_policy_attachment.dms-cloudwatch-logs-role-AmazonDMSCloudWatchLogsRole,
    aws_iam_role_policy_attachment.dms-vpc-role-AmazonDMSVPCManagementRole
  ]
}

#replication setting
{
    "Logging": {
        "EnableLogging": true,
        "LogComponents": [
            {
                "Id": "TRANSFORMATION",
                "Severity": "LOGGER_SEVERITY_DEFAULT"
            },
            {
                "Id": "SOURCE_UNLOAD",
                "Severity": "LOGGER_SEVERITY_DEFAULT"
            },
            {
                "Id": "IO",
                "Severity": "LOGGER_SEVERITY_DEFAULT"
            },
            {
                "Id": "TARGET_LOAD",
                "Severity": "LOGGER_SEVERITY_DEFAULT"
            },
            {
                "Id": "PERFORMANCE",
                "Severity": "LOGGER_SEVERITY_DEFAULT"
            },
            {
                "Id": "SOURCE_CAPTURE",
                "Severity": "LOGGER_SEVERITY_DEFAULT"
            },
            {
                "Id": "SORTER",
                "Severity": "LOGGER_SEVERITY_DEFAULT"
            },
            {
                "Id": "REST_SERVER",
                "Severity": "LOGGER_SEVERITY_DEFAULT"
            },
            {
                "Id": "VALIDATOR_EXT",
                "Severity": "LOGGER_SEVERITY_DEFAULT"
            },
            {
                "Id": "TARGET_APPLY",
                "Severity": "LOGGER_SEVERITY_DEFAULT"
            },
            {
                "Id": "TASK_MANAGER",
                "Severity": "LOGGER_SEVERITY_DEFAULT"
            },
            {
                "Id": "TABLES_MANAGER",
                "Severity": "LOGGER_SEVERITY_DEFAULT"
            },
            {
                "Id": "METADATA_MANAGER",
                "Severity": "LOGGER_SEVERITY_DEFAULT"
            },
            {
                "Id": "FILE_FACTORY",
                "Severity": "LOGGER_SEVERITY_DEFAULT"
            },
            {
                "Id": "COMMON",
                "Severity": "LOGGER_SEVERITY_DEFAULT"
            },
            {
                "Id": "ADDONS",
                "Severity": "LOGGER_SEVERITY_DEFAULT"
            },
            {
                "Id": "DATA_STRUCTURE",
                "Severity": "LOGGER_SEVERITY_DEFAULT"
            },
            {
                "Id": "COMMUNICATION",
                "Severity": "LOGGER_SEVERITY_DEFAULT"
            },
            {
                "Id": "FILE_TRANSFER",
                "Severity": "LOGGER_SEVERITY_DEFAULT"
            }
        ]
    }
}

Steps to Reproduce

apply the configuration to create a dms serverless application
try to apply again and receive the error above

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

@christyWtt christyWtt added the bug Addresses a defect in current functionality. label Jan 31, 2024
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • 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.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added the service/dms Issues and PRs that pertain to the dms service. label Jan 31, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Jan 31, 2024
@justinretzolk justinretzolk added regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. and removed needs-triage Waiting for first response or review from a maintainer. labels Feb 15, 2024
@terraform-aws-provider terraform-aws-provider bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Feb 15, 2024
@nam054 nam054 self-assigned this Feb 23, 2024
@github-actions github-actions bot added this to the v5.42.0 milestone Mar 18, 2024
@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Mar 22, 2024
Copy link

This functionality has been released in v5.42.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/dms Issues and PRs that pertain to the dms service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants