Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nestorbolivar/702e26f64817cde36ef1eb81f55eb29c to your computer and use it in GitHub Desktop.
Save nestorbolivar/702e26f64817cde36ef1eb81f55eb29c to your computer and use it in GitHub Desktop.
Terraform - Bug Message - Replacing Tag Names
terraform apply -var-file /Users/xxxxxxxx/xxxxxxxx/infra-launch/tf_vars/lt_terraform.tfvars
var.aws_profile
AWS profile in ~/.aws/credential
Enter a value: dev1
data.aws_availability_zones.all: Refreshing state...
data.aws_vpc.current_vpc: Refreshing state...
aws_eip.nat_eip.1: Refreshing state... (ID: eipalloc-fef3fa9b)
aws_eip.nat_eip.0: Refreshing state... (ID: eipalloc-e0f0f985)
aws_route_table.private_rt.1: Refreshing state... (ID: rtb-dc2c08b8)
aws_subnet.public_subnets.2: Refreshing state... (ID: subnet-f6089caf)
aws_subnet.public_subnets.0: Refreshing state... (ID: subnet-49ce8d3f)
aws_eip.nat_eip.2: Refreshing state... (ID: eipalloc-fcf2fb99)
aws_subnet.public_subnets.1: Refreshing state... (ID: subnet-929cc3f6)
aws_route_table.private_rt.2: Refreshing state... (ID: rtb-d32c08b7)
aws_route_table.private_rt.0: Refreshing state... (ID: rtb-b72d09d3)
aws_subnet.nagios_subnet.0: Refreshing state... (ID: subnet-46cf8c30)
aws_efs_file_system.nagios_fs: Refreshing state... (ID: fs-4d729674)
aws_security_group.nagios_efs_sg: Refreshing state... (ID: sg-2be7a84c)
aws_subnet.nagios_subnet.1: Refreshing state... (ID: subnet-7d9dc219)
aws_security_group.nagios_elb_sg: Refreshing state... (ID: sg-bfeaa5d8)
aws_subnet.nagios_subnet.2: Refreshing state... (ID: subnet-05099d5c)
aws_security_group.nagios_sg: Refreshing state... (ID: sg-c9e7a8ae)
aws_nat_gateway.nat_gw.2: Refreshing state... (ID: nat-0dddd6ff08e6c43b3)
aws_nat_gateway.nat_gw.0: Refreshing state... (ID: nat-0c5b01353167f87be)
aws_nat_gateway.nat_gw.1: Refreshing state... (ID: nat-046761187fc6d2e66)
aws_route_table_association.a.2: Refreshing state... (ID: rtbassoc-c4df51a3)
aws_route_table_association.a.1: Refreshing state... (ID: rtbassoc-22da5445)
aws_route_table_association.a.0: Refreshing state... (ID: rtbassoc-23da5444)
aws_route.private_nat_gateway_route.1: Refreshing state... (ID: r-rtb-dc2c08b81080289494)
aws_route.private_nat_gateway_route.0: Refreshing state... (ID: r-rtb-b72d09d31080289494)
aws_route.private_nat_gateway_route.2: Refreshing state... (ID: r-rtb-d32c08b71080289494)
aws_efs_mount_target.nagios_mount.0: Refreshing state... (ID: fsmt-f54eaacc)
aws_efs_mount_target.nagios_mount.1: Refreshing state... (ID: fsmt-f44eaacd)
aws_efs_mount_target.nagios_mount.2: Refreshing state... (ID: fsmt-f34eaaca)
aws_instance.nagios_nodes.0: Refreshing state... (ID: i-07d6f2fe53822af01)
aws_instance.nagios_nodes.1: Refreshing state... (ID: i-0af7aa8e18c02f60b)
aws_instance.nagios_nodes.2: Refreshing state... (ID: i-063d7b418d76164d8)
aws_elb.nagios_elb: Refreshing state... (ID: dev1-nagios-elb)
module.mod_nagios.aws_instance.nagios_nodes.2: Destroying... (ID: i-063d7b418d76164d8)
module.mod_nagios.aws_instance.nagios_nodes.1: Destroying... (ID: i-0af7aa8e18c02f60b)
module.mod_nagios.aws_instance.nagios_nodes.1: Still destroying... (ID: i-0af7aa8e18c02f60b, 10s elapsed)
module.mod_nagios.aws_instance.nagios_nodes.2: Still destroying... (ID: i-063d7b418d76164d8, 10s elapsed)
module.mod_nagios.aws_instance.nagios_nodes.1: Still destroying... (ID: i-0af7aa8e18c02f60b, 20s elapsed)
module.mod_nagios.aws_instance.nagios_nodes.2: Still destroying... (ID: i-063d7b418d76164d8, 10s elapsed) [15/2563]
module.mod_nagios.aws_instance.nagios_nodes.1: Still destroying... (ID: i-0af7aa8e18c02f60b, 20s elapsed)
module.mod_nagios.aws_instance.nagios_nodes.2: Still destroying... (ID: i-063d7b418d76164d8, 20s elapsed)
module.mod_nagios.aws_instance.nagios_nodes.1: Still destroying... (ID: i-0af7aa8e18c02f60b, 30s elapsed)
module.mod_nagios.aws_instance.nagios_nodes.2: Still destroying... (ID: i-063d7b418d76164d8, 30s elapsed)
module.mod_nagios.aws_instance.nagios_nodes.1: Destruction complete
module.mod_nagios.aws_instance.nagios_nodes.2: Still destroying... (ID: i-063d7b418d76164d8, 40s elapsed)
module.mod_nagios.aws_instance.nagios_nodes.2: Destruction complete
Error applying plan:
1 error(s) occurred:
* module.mod_nagios.aws_instance.nagios_nodes: aws_instance.nagios_nodes: diffs didn't match during apply. This is a bug with Terraform and should be reported as a GitHub Issue.
Please include the following information in your report:
Terraform Version: 0.9.5
Resource ID: aws_instance.nagios_nodes
Mismatch reason: diff RequiresNew; old: false, new: true
Diff One (usually from plan): *terraform.InstanceDiff{mu:sync.Mutex{state:0, sema:0x0}, Attributes:map[string]*terraform.ResourceAttrDiff{"tags.Name":*terraform.ResourceAttrDiff{Old:"dev1-mon-node-1-3
", New:"dev1-mon-node-1-1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}}, Destroy:false, DestroyDeposed:false, DestroyTainted:false, Meta
:map[string]interface {}(nil)}
Diff Two (usually from apply): *terraform.InstanceDiff{mu:sync.Mutex{state:0, sema:0x0}, Attributes:map[string]*terraform.ResourceAttrDiff{"private_ip":*terraform.ResourceAttrDiff{Old:"", New:"172.20.
40.10", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "associate_public_ip_address":*terraform.ResourceAttrDiff{Old:"", New:"false", NewCom
puted:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "placement_group":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, N
ewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "ephemeral_block_device.#":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(ni
l), RequiresNew:true, Sensitive:false, Type:0x0}, "root_block_device.0.delete_on_termination":*terraform.ResourceAttrDiff{Old:"", New:"true", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil
), RequiresNew:true, Sensitive:false, Type:0x0}, "ebs_block_device.#":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensiti
ve:false, Type:0x0}, "instance_type":*terraform.ResourceAttrDiff{Old:"", New:"t2.medium", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "p
ublic_dns":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "key_name":*terraform.ResourceAttrDiff
{Old:"", New:"dev1-b8badf7a8b77935001632932160097e9", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "network_interface_id":*terraform.Resou
rceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "primary_network_interface_id":*terraform.ResourceAttrDiff{Old:""
, New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "availability_zone":*terraform.ResourceAttrDiff{Old:"", New:"ap-southeast-2a", NewC
omputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "tags.%":*terraform.ResourceAttrDiff{Old:"", New:"2", NewComputed:false, NewRemoved:false, NewExt
ra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "ami":*terraform.ResourceAttrDiff{Old:"", New:"ami-67ada304", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), Requires
New:true, Sensitive:false, Type:0x0}, "tenancy":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "i
pv6_addresses.#":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "tags.Cluster":*terraform.Resourc
eAttrDiff{Old:"", New:"dev1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "ipv6_address_count":*terraform.ResourceAttrDiff{Old:"", New:"
", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "source_dest_check":*terraform.ResourceAttrDiff{Old:"", New:"false", NewComputed:false, New
Removed:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "root_block_device.0.volume_type":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false,
NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "network_interface.#":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil),
RequiresNew:false, Sensitive:false, Type:0x0}, "vpc_security_group_ids.#":*terraform.ResourceAttrDiff{Old:"", New:"1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, S
ensitive:false, Type:0x0}, "security_groups.#":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "us
er_data":*terraform.ResourceAttrDiff{Old:"", New:"4343e895e78b634133a6c643cf2ee05ba68d3d99", NewComputed:false, NewRemoved:false, NewExtra:"#!/bin/bash\nsudo mkdir -p /usr/local/nagios\nsudo yum install -
y nfs-utils\nsudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 \\\n \"fs-4d729674\".efs.ap-southeast-2.amazonaws.com:/ /usr/local/nagios\nsudo echo \"\"fs-4d729674\".
efs.ap-southeast-2.amazonaws.com:/ /usr/local/nagios nfs nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 0 0\" >> /etc/fstab\nsudo mkdir -p /usr/local/nagios\nsudo yum install -y nfs-util
s\nsudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 \\\n \"fs-4d729674\".efs.ap-southeast-2.amazonaws.com:/ /usr/local/nagios\n", RequiresNew:true, Sensitive:false,
Type:0x0}, "root_block_device.#":*terraform.ResourceAttrDiff{Old:"", New:"1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "volume_tags.%
":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "instance_state":*terraform.ResourceAttrDiff{Ol
d:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "tags.Name":*terraform.ResourceAttrDiff{Old:"", New:"dev1-mon-node-1-1", NewCom
puted:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "root_block_device.0.iops":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemove
d:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "root_block_device.0.volume_size":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtr
a:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "vpc_security_group_ids.2360977722":*terraform.ResourceAttrDiff{Old:"", New:"sg-c9e7a8ae", NewComputed:false, NewRemoved:false, NewExtra:
interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "public_ip":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false,
Sensitive:false, Type:0x0}, "private_dns":*terraform.ResourceAttrDiff{Old:"", New:"", NewComputed:true, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:false, Sensitive:false, Type:0x0}, "subne
t_id":*terraform.ResourceAttrDiff{Old:"", New:"subnet-46cf8c30", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}}, Destroy:false, DestroyDepos
ed:false, DestroyTainted:false, Meta:map[string]interface {}(nil)}
Also include as much context as you can about your config, state, and the steps you performed to trigger this error.
Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment