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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modifying a dms replication task type should taint resource #18450

Open
pancochea opened this issue Mar 29, 2021 · 5 comments
Open

Modifying a dms replication task type should taint resource #18450

pancochea opened this issue Mar 29, 2021 · 5 comments
Labels
bug Addresses a defect in current functionality. service/dms Issues and PRs that pertain to the dms service. stale Old or inactive issues managed by automation, if no further action taken these will get closed.

Comments

@pancochea
Copy link

pancochea commented Mar 29, 2021

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

Affected Resource(s)

  • aws_dms_replication_task

Terraform Configuration Files

resource "aws_dms_replication_task" "testing-replication-task" {
  migration_type           = "cdc"
  replication_instance_arn = aws_dms_replication_instance.replication instance.replication_instance_arn
  replication_task_id      =  "test-replication"
  source_endpoint_arn      = aws_dms_endpoint.source.endpoint_arn

  target_endpoint_arn = aws_dms_endpoint.target.endpoint_arn

}

Modified configuration:

resource "aws_dms_replication_task" "testing-replication-task" {
  migration_type           = "full-load"
  replication_instance_arn = aws_dms_replication_instance.replication instance.replication_instance_arn
  replication_task_id      =  "test-replication"
  source_endpoint_arn      = aws_dms_endpoint.source.endpoint_arn

  target_endpoint_arn = aws_dms_endpoint.target.endpoint_arn

}

Expected Behavior

The resource type is changed.

Actual Behavior

An error raises stating that the resource type cannot be modified at this moment:

Error: InvalidResourceStateFault: Replication Task, excluding logging severity task settings, cannot be modified while it is running state

Steps to Reproduce

  1. terraform apply
  2. Wait for resources to be avaliable
  3. Change the replication type configuration of that resource.
  4. terraform plan will state that the resource type will be changed
  5. terraform apply fails

Important Factoids

Changing the replication type of an existing should destroy and recreate the resource. From the GUI and the api this parameter cannot be modified.

The aws-cli states that using the modify-replication-task command is able to perform this change, but running it raises the same error (as expected), so it could be an error from the aws API, or a combination of the current replication task type and the new target type.

References

https://awscli.amazonaws.com/v2/documentation/api/latest/reference/dms/modify-replication-task.html

@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Mar 29, 2021
@anGie44 anGie44 added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Apr 1, 2021
@anGie44
Copy link
Contributor

anGie44 commented Apr 1, 2021

Hi @pancochea , thank you for raising this issue! looking at the AWS documentation, looks like we need to be stopping the task before performing any modifications (https://docs.aws.amazon.com/dms/latest/APIReference/API_ModifyReplicationTask.html). we don't currently do so; instead we directly call ModifyReplicationTask. afict, modifying the migration_type is technically supported, so we'll have to update the resource's Update logic to include a call toStopReplicationTask and give it a try in a new acceptance test 馃憤

@pancochea
Copy link
Author

Hi @anGie44, just to let you know, if you are going to change the Update behavior to stop a task, I think this issue #16092 and the linked pull request will be useful (#16092). That issue has been aroudn for quite a while and will solve a lot of problems.

@anGie44
Copy link
Contributor

anGie44 commented Apr 5, 2021

Thank you @pancochea for linking the issue!

Noting this also relates to: #2236

@fermezz
Copy link
Contributor

fermezz commented May 9, 2022

Stopping the task is one part of the problem, which was solved by a PR of mine. But I think this issue still stands. AWS won't allow the task type to be modified even if the task is stopped. I think we need to modify the logic to destroy the task if this parameter is changed.

@ewbankkit ewbankkit added the service/dms Issues and PRs that pertain to the dms service. label Jun 2, 2022
Copy link

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!

@github-actions github-actions bot added the stale Old or inactive issues managed by automation, if no further action taken these will get closed. label May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. service/dms Issues and PRs that pertain to the dms service. stale Old or inactive issues managed by automation, if no further action taken these will get closed.
Projects
None yet
Development

No branches or pull requests

5 participants