pacbot icon indicating copy to clipboard operation
pacbot copied to clipboard

Terraform Error Handling

Open jonshern opened this issue 8 years ago • 3 comments

There are times when it makes sense to modify the terraform in order to customize certain parts. An example is i want to make the alb public or something. The current way the terraform is ran it will just roll over a syntax error and just keep creating everything. This creates a lot of problems and many times ends up in a full destroy recreate cycle. I referenced the terraform plan/apply workflow in another issues, and this is related but a little different.

jonshern avatar Oct 29 '18 14:10 jonshern

Today i had the case where my ssh timed out. After it timed out i went to the console to check what was created. I could see both ALB's were created, but the site was not pushed yet. So i reran the deployment, it succeeded and when I check the ALB for the UI layer was no longer there. when i looked at the logs it is not evident that the ALB was destroyed.

However at the bottom it still gives me the old ALB Address that existed before deleting.

-east-1:...cb90/f7b1912ae7809a40/efc1eb16c159b885) aws_ecs_service.statistics: Modifying... (ID: arn:aws:ecs:us-east-1:123456056032:service/statistics) task_definition: "statistics:48" => "statistics:49" aws_lb_listener_rule.admin: Creation complete after 1s (ID: arn:aws:elasticloadbalancing:us-east-1:...cb90/f7b1912ae7809a40/c59a33c64a33083f) aws_ecs_service.admin: Modifying... (ID: arn:aws:ecs:us-east-1:123456056032:service/admin) task_definition: "admin:48" => "admin:49" aws_ecs_service.statistics: Modifications complete after 0s (ID: arn:aws:ecs:us-east-1:123456056032:service/statistics) aws_ecs_service.admin: Modifications complete after 0s (ID: arn:aws:ecs:us-east-1:123456056032:service/admin) aws_lb_listener_rule.notifications: Creation complete after 2s (ID: arn:aws:elasticloadbalancing:us-east-1:...cb90/f7b1912ae7809a40/a5cbef2088aad2ba) aws_ecs_service.notifications: Modifying... (ID: arn:aws:ecs:us-east-1:123456056032:service/notifications) task_definition: "notifications:48" => "notifications:49" aws_lb_listener_rule.compliance: Creation complete after 2s (ID: arn:aws:elasticloadbalancing:us-east-1:...cb90/f7b1912ae7809a40/1664f79c5376039d) aws_ecs_service.compliance: Modifying... (ID: arn:aws:ecs:us-east-1:123456056032:service/compliance) task_definition: "compliance:48" => "compliance:49" aws_ecs_service.notifications: Modifications complete after 0s (ID: arn:aws:ecs:us-east-1:123456056032:service/notifications) aws_ecs_service.compliance: Modifications complete after 0s (ID: arn:aws:ecs:us-east-1:123456056032:service/compliance) aws_lb_listener_rule.asset: Creation complete after 4s (ID: arn:aws:elasticloadbalancing:us-east-1:...cb90/f7b1912ae7809a40/4fdb92f1ea765b6c) aws_ecs_service.asset: Modifying... (ID: arn:aws:ecs:us-east-1:123456056032:service/asset) task_definition: "asset:48" => "asset:49" aws_ecs_service.asset: Modifications complete after 0s (ID: arn:aws:ecs:us-east-1:123456056032:service/asset)

Apply complete! Resources: 17 added, 7 changed, 7 destroyed.

jonshern avatar Oct 29 '18 16:10 jonshern

There are times when it makes sense to modify the terraform in order to customize certain parts. An example is i want to make the alb public or something. The current way the terraform is ran it will just roll over a syntax error and just keep creating everything. This creates a lot of problems and many times ends up in a full destroy recreate cycle. I referenced the terraform plan/apply workflow in another issues, and this is related but a little different.

Hi @jonshern

Resources like ALB doesn't support modifying scheme(Internet facing to internal or vice-versa). There are lot of resources which have such limitations. So if you modify any parameter then according the AWS criteria, it may re-create or update. Since terraform files have been created with dependencies, recreation of one resource will result in the re-creation of resources which depends on this. We have revamped the old installation script and fixed many issues. Could you please try the new installer.

sajeer-nooh avatar Feb 04 '19 05:02 sajeer-nooh

Today i had the case where my ssh timed out. After it timed out i went to the console to check what was created. I could see both ALB's were created, but the site was not pushed yet. So i reran the deployment, it succeeded and when I check the ALB for the UI layer was no longer there. when i looked at the logs it is not evident that the ALB was destroyed.

However at the bottom it still gives me the old ALB Address that existed before deleting.

-east-1:...cb90/f7b1912ae7809a40/efc1eb16c159b885) aws_ecs_service.statistics: Modifying... (ID: arn:aws:ecs:us-east-1:123456056032:service/statistics) task_definition: "statistics:48" => "statistics:49" aws_lb_listener_rule.admin: Creation complete after 1s (ID: arn:aws:elasticloadbalancing:us-east-1:...cb90/f7b1912ae7809a40/c59a33c64a33083f) aws_ecs_service.admin: Modifying... (ID: arn:aws:ecs:us-east-1:123456056032:service/admin) task_definition: "admin:48" => "admin:49" aws_ecs_service.statistics: Modifications complete after 0s (ID: arn:aws:ecs:us-east-1:123456056032:service/statistics) aws_ecs_service.admin: Modifications complete after 0s (ID: arn:aws:ecs:us-east-1:123456056032:service/admin) aws_lb_listener_rule.notifications: Creation complete after 2s (ID: arn:aws:elasticloadbalancing:us-east-1:...cb90/f7b1912ae7809a40/a5cbef2088aad2ba) aws_ecs_service.notifications: Modifying... (ID: arn:aws:ecs:us-east-1:123456056032:service/notifications) task_definition: "notifications:48" => "notifications:49" aws_lb_listener_rule.compliance: Creation complete after 2s (ID: arn:aws:elasticloadbalancing:us-east-1:...cb90/f7b1912ae7809a40/1664f79c5376039d) aws_ecs_service.compliance: Modifying... (ID: arn:aws:ecs:us-east-1:123456056032:service/compliance) task_definition: "compliance:48" => "compliance:49" aws_ecs_service.notifications: Modifications complete after 0s (ID: arn:aws:ecs:us-east-1:123456056032:service/notifications) aws_ecs_service.compliance: Modifications complete after 0s (ID: arn:aws:ecs:us-east-1:123456056032:service/compliance) aws_lb_listener_rule.asset: Creation complete after 4s (ID: arn:aws:elasticloadbalancing:us-east-1:...cb90/f7b1912ae7809a40/4fdb92f1ea765b6c) aws_ecs_service.asset: Modifying... (ID: arn:aws:ecs:us-east-1:123456056032:service/asset) task_definition: "asset:48" => "asset:49" aws_ecs_service.asset: Modifications complete after 0s (ID: arn:aws:ecs:us-east-1:123456056032:service/asset)

Apply complete! Resources: 17 added, 7 changed, 7 destroyed.

We have revamped the old installation script and fixed many issues. Could you please try the new installer.

sajeer-nooh avatar Feb 04 '19 05:02 sajeer-nooh