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 #35493

Closed
christyWtt opened this issue Jan 26, 2024 · 3 comments
Closed

[Bug]: aws_dms_replication_config has persistent changes #35493

christyWtt opened this issue Jan 26, 2024 · 3 comments
Labels
bug Addresses a defect in current functionality. service/dms Issues and PRs that pertain to the dms service.

Comments

@christyWtt
Copy link

christyWtt commented Jan 26, 2024

Terraform Core Version

1.3.1

AWS Provider Version

5.31.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.

Relevant Error/Panic Output Snippet

# On plan:
 # module.dms_full_load_serverless_replications.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:xxx:replication-config:xxx-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-xxx-cdc" -> null
                  - CloudWatchLogStream = "dms-serverless-serv-res-id-xxx-b4gn" -> 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"   = "xxx"
            "Domain"   = "xxx"
            "Solution" = "xxx"
            "Type"     = "xxx"
            "Use"      = "xxx"
        }
        # (9 unchanged attributes hidden)
        # (1 unchanged block hidden)
    }

# On apply:
Error: updating DMS Replication Config (arn:aws:dms:us-east-1:xxx:replication-config:load-xxx-domain): InvalidParameterValueException: Replication with replication config arn 'arn:aws:dms:us-east-1:xxx:replication-config:load-xxx-domain' cannot be modified as the replication is in deprovisioning. You can only modify replication configs before provisioning capacity.
│ 	status code: 400, request id: ab04b1d6-4d9f-4a5e-a880-b8f1a676dca9
│ 
│   with module.dms_full_load_serverless_replications.aws_dms_replication_config.dms_full_load_serverless_replication[3],
│   on ../../../modules/dms/instance/dms_replication_instance.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


resource "aws_dms_replication_config" "dms_full_load_serverless_replication" {
  count = length(var.full_load_domain_list)

  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

  1. apply the configuration to create a dms serverless application
  2. 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 26, 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 26, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Jan 26, 2024
@justinretzolk
Copy link
Member

Hey @christyWtt 👋 Thank you for taking the time to raise this! This was fixed with #34356, which was included with version 5.32.0 of the provider. Given that this was a known issue that was recently fixed, we'll close this issue. If you have additional issues after upgrading, please open a new issue, referencing this one as needed.

@terraform-aws-provider terraform-aws-provider bot removed the needs-triage Waiting for first response or review from a maintainer. label Jan 26, 2024
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 Feb 26, 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. service/dms Issues and PRs that pertain to the dms service.
Projects
None yet
Development

No branches or pull requests

2 participants