Terraform will perform the following actions:
# module.applications.module.checkout.module.service_dns.aws_route53_record.weighted_main_migration[0] will be updated in-place
~ resource "aws_route53_record" "weighted_main_migration" {
id = "{ID}"
name = "checkout.app"
# (6 unchanged attributes hidden)
~ weighted_routing_policy {
~ weight = 70 -> 0
}
# (1 unchanged block hidden)
}
# module.applications.module.checkout.module.service_dns.aws_route53_record.weighted_new_migration[0] will be updated in-place
~ resource "aws_route53_record" "weighted_new_migration" {
id = "{ID}"
name = "checkout.app"
# (6 unchanged attributes hidden)
~ weighted_routing_policy {
~ weight = 30 -> 100
}
# (1 unchanged block hidden)
}
Plan: 0 to add, 2 to change, 0 to destroy.
tf apply plan.tfplan
Run in new (clean after 100% move):
tf state mv [NEW_MODULE_PATH].module.service_dns.aws_route53_record.weighted_new_migration[0] [NEW_MODULE_PATH].module.service_dns.aws_route53_record.main_migrated[0]
tf import [NEW_MODULE_PATH].module.service.aws_ecs_task_definition.main[0] [TASK_DEFINITION_ARN]
Run in new:
tf plan -out plan.tfplan -target [NEW_MODULE_PATH].module.service_dns.aws_route53_record.weighted_main_migration[0]
Terraform will perform the following actions:
# module.applications.module.checkout.module.service_dns.aws_route53_record.weighted_main_migration[0] will be destroyed
# (because index [0] is out of range for count)
- resource "aws_route53_record" "weighted_main_migration" {
- fqdn = "{FQDN}" -> null
- id = "{ID}" -> null
- name = "checkout.app" -> null
- records = [] -> null
- set_identifier = "main_migration" -> null
- ttl = 0 -> null
- type = "A" -> null
- zone_id = "{ZONE_ID}" -> null
- alias {
- evaluate_target_health = false -> null
- name = "{DNS_NAME}" -> null
- zone_id = "{ZONE_ID}" -> null
}
- weighted_routing_policy {
- weight = 0 -> null
}
}
Plan: 0 to add, 0 to change, 1 to destroy.
tf apply plan.tfplan
Run in new:
tf plan -out plan.tfplan
Terraform will perform the following actions:
# module.applications.module.checkout.module.service_dns.aws_route53_record.main_migrated[0] will be updated in-place
~ resource "aws_route53_record" "main_migrated" {
id = "{ID}"
name = "checkout.app"
- set_identifier = "new_migration" -> null
# (5 unchanged attributes hidden)
- weighted_routing_policy {
- weight = 100 -> null
}
# (1 unchanged block hidden)
}
tf apply plan.tfplan
Run in old:
tf state rm [OLD_MODULE_PATH].module.service.aws_ecs_task_definition.main[0]
tf state rm [OLD_MODULE_PATH].module.service.aws_security_group.task[0]
tf state rm [OLD_MODULE_PATH].module.service.aws_security_group_rule.permit_all_lb_egress_fargate[0]
tf state rm [OLD_MODULE_PATH].module.service.aws_security_group_rule.permit_all_task_egress[0]
tf state rm [OLD_MODULE_PATH].module.service.aws_security_group_rule.permit_container_port_alb[0]
tf state rm [OLD_MODULE_PATH].module.service.aws_security_group_rule.permit_vpn_to_task[0]
tf state rm [OLD_MODULE_PATH].module.service_dns.aws_route53_record.main_migrated[0]
Run in old:
tf plan -out plan.tfplan
Terraform will perform the following actions:
# module.applications.module.checkout[0].module.service.aws_alb_listener_rule.host_rule[0] will be destroyed
# module.applications.module.checkout[0].module.service.aws_alb_target_group.main[0] will be destroyed
# module.applications.module.checkout[0].module.service.aws_ecs_service.fargate[0] will be destroyed