ibm-cloud-architecture / terraform-icp-aws

This Terraform configurations uses the AWS provider to provision virtual machines on AWS to prepare VMs and deploy IBM Cloud Private on them. This Terraform template automates best practices learned from installing ICP on AWS at numerous client sites in production.
9 stars 30 forks source link

add lifecycle to avoid forcing new vms #34

Open hassenius opened 5 years ago

hassenius commented 5 years ago

Currently when doing a plan/apply on existing cluster the AWS provider might force rebuilding of nodes with something like

.aws_instance.icpnodes[2] (new resource required)
      id:                                                "i-0c3ef0428115d26cb" => <computed> (forces new resource)
      ami:                                               "ami-0cbf7a0c36bde57c9" => "ami-0cbf7a0c36bde57c9"
      arn:                                               "arn:aws:ec2:eu-west-1:675801125365:instance/i-0c3ef0428115d26cb" => <computed>
      associate_public_ip_address:                       "false" => <computed>
      availability_zone:                                 "eu-west-1c" => "eu-west-1c"
      cpu_core_count:                                    "4" => <computed>
      cpu_threads_per_core:                              "2" => <computed>
      ebs_block_device.#:                                "2" => "1"
      ebs_block_device.3042545595.delete_on_termination: "false" => "false"
      ebs_block_device.3042545595.device_name:           "/dev/xvdbc" => "" (forces new resource)

as per https://github.com/terraform-providers/terraform-provider-aws/issues/2036 ignore ebs_block_device to fix this