hashicorp / terraform

Terraform enables you to safely and predictably create, change, and improve infrastructure. It is a source-available tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.
https://www.terraform.io/
Other
42.35k stars 9.49k forks source link

Diffs Not Matching Apply - Reporting Per Instructions in Output #982

Closed gamename closed 9 years ago

gamename commented 9 years ago

tennis@tennisMBP: ~/Documents/inf-catalog/terraform (postgres|✗…)

./tf apply aws_vpc.catalog: Creating... cidr_block: "" => "10.0.0.0/16" default_network_acl_id: "" => "" default_security_group_id: "" => "" enable_dns_hostnames: "" => "1" enable_dns_support: "" => "1" main_route_table_id: "" => "" tags.#: "" => "2" tags.Environment: "" => "testing" tags.Name: "" => "catalog" aws_vpc.catalog: Creation complete aws_security_group.rethinkdb_cluster: Creating... description: "" => "allow rethinkdb cluster traffic" ingress.#: "" => "1" ingress.1558883644.cidr_blocks.#: "" => "0" ingress.1558883644.from_port: "" => "29015" ingress.1558883644.protocol: "" => "tcp" ingress.1558883644.security_groups.#: "" => "0" ingress.1558883644.self: "" => "1" ingress.1558883644.to_port: "" => "29015" name: "" => "rethinkdb_cluster" owner_id: "" => "" tags.#: "" => "1" tags.Environment: "" => "testing" vpc_id: "" => "vpc-831e65e6" aws_security_group.postgresdb_cluster: Creating... description: "" => "allow postgresdb cluster traffic" ingress.#: "" => "4" ingress.1712012281.cidr_blocks.#: "" => "0" ingress.1712012281.from_port: "" => "22" ingress.1712012281.protocol: "" => "tcp" ingress.1712012281.security_groups.#: "" => "0" ingress.1712012281.self: "" => "1" ingress.1712012281.to_port: "" => "22" ingress.2450194534.cidr_blocks.#: "" => "0" ingress.2450194534.from_port: "" => "-1" ingress.2450194534.protocol: "" => "icmp" ingress.2450194534.security_groups.#: "" => "0" ingress.2450194534.self: "" => "1" ingress.2450194534.to_port: "" => "-1" ingress.3631810329.cidr_blocks.#: "" => "0" ingress.3631810329.from_port: "" => "5432" ingress.3631810329.protocol: "" => "tcp" ingress.3631810329.security_groups.#: "" => "0" ingress.3631810329.self: "" => "1" ingress.3631810329.to_port: "" => "5432" ingress.517408620.cidr_blocks.#: "" => "0" ingress.517408620.from_port: "" => "7789" ingress.517408620.protocol: "" => "tcp" ingress.517408620.security_groups.#: "" => "0" ingress.517408620.self: "" => "1" ingress.517408620.to_port: "" => "7789" name: "" => "postgresdb_cluster" owner_id: "" => "" tags.#: "" => "1" tags.Environment: "" => "testing" vpc_id: "" => "vpc-831e65e6" aws_subnet.private_subnets.2: Creating... availability_zone: "" => "us-east-1e" cidr_block: "" => "10.0.128.0/19" tags.#: "" => "2" tags.Environment: "" => "testing" tags.Name: "" => "private_2" vpc_id: "" => "vpc-831e65e6" aws_subnet.private_subnets.1: Creating... availability_zone: "" => "us-east-1d" cidr_block: "" => "10.0.64.0/19" tags.#: "" => "2" tags.Environment: "" => "testing" tags.Name: "" => "private_1" vpc_id: "" => "vpc-831e65e6" aws_subnet.private_subnets.0: Creating... availability_zone: "" => "us-east-1a" cidr_block: "" => "10.0.0.0/19" tags.#: "" => "2" tags.Environment: "" => "testing" tags.Name: "" => "private_0" vpc_id: "" => "vpc-831e65e6" aws_subnet.public_subnets.2: Creating... availability_zone: "" => "us-east-1e" cidr_block: "" => "10.0.160.0/20" map_public_ip_on_launch: "" => "1" tags.#: "" => "2" tags.Environment: "" => "testing" tags.Name: "" => "public_2" vpc_id: "" => "vpc-831e65e6" aws_subnet.public_subnets.1: Creating... availability_zone: "" => "us-east-1d" cidr_block: "" => "10.0.96.0/20" map_public_ip_on_launch: "" => "1" tags.#: "" => "2" tags.Environment: "" => "testing" tags.Name: "" => "public_1" vpc_id: "" => "vpc-831e65e6" aws_subnet.public_subnets.0: Creating... availability_zone: "" => "us-east-1a" cidr_block: "" => "10.0.32.0/20" map_public_ip_on_launch: "" => "1" tags.#: "" => "2" tags.Environment: "" => "testing" tags.Name: "" => "public_0" vpc_id: "" => "vpc-831e65e6" aws_internet_gateway.gw: Creating... vpc_id: "" => "vpc-831e65e6" aws_security_group.external_ssh_access: Creating... description: "" => "allow ssh to nat instances from outside" ingress.#: "" => "1" ingress.2551330357.cidr_blocks.#: "" => "2" ingress.2551330357.cidr_blocks.0: "" => "98.240.50.117/32" ingress.2551330357.cidr_blocks.1: "" => "67.177.166.184/32" ingress.2551330357.from_port: "" => "22" ingress.2551330357.protocol: "" => "tcp" ingress.2551330357.security_groups.#: "" => "0" ingress.2551330357.self: "" => "0" ingress.2551330357.to_port: "" => "22" name: "" => "external_ssh_access" owner_id: "" => "" vpc_id: "" => "vpc-831e65e6" aws_internet_gateway.gw: Creation complete aws_security_group.nat: Creating... description: "" => "allow internet traffic" ingress.#: "" => "3" ingress.32090245.cidr_blocks.#: "" => "1" ingress.32090245.cidr_blocks.0: "" => "0.0.0.0/0" ingress.32090245.from_port: "" => "-1" ingress.32090245.protocol: "" => "icmp" ingress.32090245.security_groups.#: "" => "0" ingress.32090245.self: "" => "0" ingress.32090245.to_port: "" => "-1" ingress.328410206.cidr_blocks.#: "" => "1" ingress.328410206.cidr_blocks.0: "" => "0.0.0.0/0" ingress.328410206.from_port: "" => "0" ingress.328410206.protocol: "" => "udp" ingress.328410206.security_groups.#: "" => "0" ingress.328410206.self: "" => "0" ingress.328410206.to_port: "" => "65535" ingress.4092576624.cidr_blocks.#: "" => "1" ingress.4092576624.cidr_blocks.0: "" => "0.0.0.0/0" ingress.4092576624.from_port: "" => "0" ingress.4092576624.protocol: "" => "tcp" ingress.4092576624.security_groups.#: "" => "0" ingress.4092576624.self: "" => "0" ingress.4092576624.to_port: "" => "65535" name: "" => "nat" owner_id: "" => "" vpc_id: "" => "vpc-831e65e6" aws_subnet.private_subnets.2: Creation complete aws_security_group.load_balancer: Creating... description: "" => "allow incoming http traffic" ingress.#: "" => "1" ingress.2603706321.cidr_blocks.#: "" => "1" ingress.2603706321.cidr_blocks.0: "" => "0.0.0.0/0" ingress.2603706321.from_port: "" => "80" ingress.2603706321.protocol: "" => "tcp" ingress.2603706321.security_groups.#: "" => "0" ingress.2603706321.self: "" => "0" ingress.2603706321.to_port: "" => "80" name: "" => "load_balancer" owner_id: "" => "" tags.#: "" => "1" tags.Environment: "" => "testing" vpc_id: "" => "vpc-831e65e6" aws_subnet.private_subnets.0: Creation complete aws_security_group.consul_agent: Creating... description: "" => "allow all consul agent tcp traffic" ingress.#: "" => "2" ingress.267550030.cidr_blocks.#: "" => "1" ingress.267550030.cidr_blocks.0: "" => "10.0.0.0/16" ingress.267550030.from_port: "" => "8301" ingress.267550030.protocol: "" => "tcp" ingress.267550030.security_groups.#: "" => "0" ingress.267550030.self: "" => "0" ingress.267550030.to_port: "" => "8301" ingress.983294917.cidr_blocks.#: "" => "1" ingress.983294917.cidr_blocks.0: "" => "10.0.0.0/16" ingress.983294917.from_port: "" => "8301" ingress.983294917.protocol: "" => "udp" ingress.983294917.security_groups.#: "" => "0" ingress.983294917.self: "" => "0" ingress.983294917.to_port: "" => "8301" name: "" => "consul_agent_tcp" owner_id: "" => "" tags.#: "" => "1" tags.Environment: "" => "testing" vpc_id: "" => "vpc-831e65e6" aws_security_group.external_ssh_access: Creation complete aws_security_group.consul_server: Creating... description: "" => "allow all consul server traffic" ingress.#: "" => "1" ingress.2077434235.cidr_blocks.#: "" => "1" ingress.2077434235.cidr_blocks.0: "" => "10.0.0.0/16" ingress.2077434235.from_port: "" => "8300" ingress.2077434235.protocol: "" => "tcp" ingress.2077434235.security_groups.#: "" => "0" ingress.2077434235.self: "" => "0" ingress.2077434235.to_port: "" => "8300" name: "" => "consul_server" owner_id: "" => "" tags.#: "" => "1" tags.Environment: "" => "testing" vpc_id: "" => "vpc-831e65e6" aws_subnet.public_subnets.2: Creation complete aws_route_table.public_routes: Creating... route.#: "" => "1" route.1831747878.cidr_block: "" => "0.0.0.0/0" route.1831747878.gateway_id: "" => "igw-b5aa2bd0" route.1831747878.instance_id: "" => "" tags.#: "" => "2" tags.Environment: "" => "testing" tags.Name: "" => "public" vpc_id: "" => "vpc-831e65e6" aws_subnet.private_subnets.1: Creation complete aws_subnet.public_subnets.1: Creation complete aws_security_group.rethinkdb_cluster: Creation complete aws_security_group.postgresdb_cluster: Creation complete aws_subnet.public_subnets.0: Creation complete aws_security_group.nat: Creation complete aws_security_group.internal_ssh_access: Creating... description: "" => "allow ssh from nat instances" ingress.#: "" => "1" ingress.4003479348.cidr_blocks.#: "" => "0" ingress.4003479348.from_port: "" => "22" ingress.4003479348.protocol: "" => "tcp" ingress.4003479348.security_groups.#: "" => "1" ingress.4003479348.security_groups.1467514830: "" => "sg-12b90976" ingress.4003479348.self: "" => "0" ingress.4003479348.to_port: "" => "22" name: "" => "internal_ssh_access" owner_id: "" => "" vpc_id: "" => "vpc-831e65e6" aws_route_table.public_routes: Creation complete aws_route_table_association.public.2: Creating... route_table_id: "" => "rtb-dbcd98be" subnet_id: "" => "subnet-f2d793c8" aws_route_table_association.public.1: Creating... route_table_id: "" => "rtb-dbcd98be" subnet_id: "" => "subnet-513da026" aws_route_table_association.public.0: Creating... route_table_id: "" => "rtb-dbcd98be" subnet_id: "" => "subnet-4a8a3713" aws_security_group.load_balancer: Creation complete aws_security_group.consul_server: Creation complete aws_security_group.consul_agent: Creation complete aws_route_table_association.public.2: Creation complete aws_route_table_association.public.1: Creation complete aws_route_table_association.public.0: Creation complete aws_security_group.internal_ssh_access: Creation complete aws_instance.nat: Creating... ami: "" => "ami-921359fa" availability_zone: "" => "" block_device.#: "" => "" iam_instance_profile: "" => "catalog_api" instance_type: "" => "t2.micro" key_name: "" => "tennis" private_dns: "" => "" private_ip: "" => "" public_dns: "" => "" public_ip: "" => "" security_groups.#: "" => "4" security_groups.1141206176: "" => "sg-1eb9097a" security_groups.1467514830: "" => "sg-12b90976" security_groups.1965728998: "" => "sg-17b90973" security_groups.895660234: "" => "sg-1cb90978" source_dest_check: "" => "0" subnet_id: "" => "subnet-4a8a3713" tags.#: "" => "3" tags.Environment: "" => "testing" tags.Name: "" => "nat_0" tags.Role: "" => "nat" tenancy: "" => "" aws_launch_configuration.rethinkdb_server: Creating... associate_public_ip_address: "" => "0" image_id: "" => "ami-921359fa" instance_type: "" => "t2.small" key_name: "" => "tennis" name: "" => "rethinkdb_server" security_groups.#: "" => "3" security_groups.1141206176: "" => "sg-1eb9097a" security_groups.787025867: "" => "sg-10b90974" security_groups.895660234: "" => "sg-1cb90978" aws_instance.postgres.1: Creating... ami: "" => "ami-921359fa" availability_zone: "" => "" block_device.#: "" => "1" block_device.3121104763.delete_on_termination: "" => "1" block_device.3121104763.device_name: "" => "/dev/xvdf" block_device.3121104763.encrypted: "" => "" block_device.3121104763.snapshot_id: "" => "" block_device.3121104763.virtual_name: "" => "" block_device.3121104763.volume_size: "" => "10" block_device.3121104763.volume_type: "" => "" iam_instance_profile: "" => "catalog_api" instance_type: "" => "t2.micro" key_name: "" => "tennis" private_dns: "" => "" private_ip: "" => "" public_dns: "" => "" public_ip: "" => "" security_groups.#: "" => "3" security_groups.1141206176: "" => "sg-1eb9097a" security_groups.4288230633: "" => "sg-11b90975" security_groups.895660234: "" => "sg-1cb90978" source_dest_check: "" => "0" subnet_id: "" => "subnet-503da027" tags.#: "" => "3" tags.Environment: "" => "testing" tags.Name: "" => "postgres_1" tags.Role: "" => "postgresdb_servers" tenancy: "" => "" aws_instance.postgres.0: Creating... ami: "" => "ami-921359fa" availability_zone: "" => "" block_device.#: "" => "1" block_device.3121104763.delete_on_termination: "" => "1" block_device.3121104763.device_name: "" => "/dev/xvdf" block_device.3121104763.encrypted: "" => "" block_device.3121104763.snapshot_id: "" => "" block_device.3121104763.virtual_name: "" => "" block_device.3121104763.volume_size: "" => "10" block_device.3121104763.volume_type: "" => "" iam_instance_profile: "" => "catalog_api" instance_type: "" => "t2.micro" key_name: "" => "tennis" private_dns: "" => "" private_ip: "" => "" public_dns: "" => "" public_ip: "" => "" security_groups.#: "" => "3" security_groups.1141206176: "" => "sg-1eb9097a" security_groups.4288230633: "" => "sg-11b90975" security_groups.895660234: "" => "sg-1cb90978" source_dest_check: "" => "0" subnet_id: "" => "subnet-4b8a3712" tags.#: "" => "3" tags.Environment: "" => "testing" tags.Name: "" => "postgres_0" tags.Role: "" => "postgresdb_servers" tenancy: "" => "" aws_launch_configuration.load_balancer: Creating... associate_public_ip_address: "" => "0" image_id: "" => "ami-921359fa" instance_type: "" => "t2.micro" key_name: "" => "tennis" name: "" => "load_balancer" security_groups.#: "" => "3" security_groups.1141206176: "" => "sg-1eb9097a" security_groups.2248688876: "" => "sg-13b90977" security_groups.895660234: "" => "sg-1cb90978" aws_launch_configuration.consul_launch_configuration: Creating... associate_public_ip_address: "" => "0" image_id: "" => "ami-921359fa" instance_type: "" => "t2.micro" key_name: "" => "tennis" name: "" => "consul_launch_configuration" security_groups.#: "" => "3" security_groups.1141206176: "" => "sg-1eb9097a" security_groups.2277686994: "" => "sg-1db90979" security_groups.895660234: "" => "sg-1cb90978" aws_launch_configuration.consul_launch_configuration: Creation complete aws_launch_configuration.load_balancer: Creation complete aws_launch_configuration.rethinkdb_server: Creation complete aws_instance.nat: Creation complete aws_route_table.private_routes: Creating... route.#: "" => "1" route.4261326527.cidr_block: "" => "0.0.0.0/0" route.4261326527.gateway_id: "" => "" route.4261326527.instance_id: "" => "i-4d8e33a2" tags.#: "" => "2" tags.Environment: "" => "testing" tags.Name: "" => "private" vpc_id: "" => "vpc-831e65e6" aws_instance.postgres.0: Creation complete aws_route_table.private_routes: Creation complete aws_route_table_association.private.2: Creating... route_table_id: "" => "rtb-b1cd98d4" subnet_id: "" => "subnet-f3d793c9" aws_route_table_association.private.1: Creating... route_table_id: "" => "rtb-b1cd98d4" subnet_id: "" => "subnet-503da027" aws_route_table_association.private.0: Creating... route_table_id: "" => "rtb-b1cd98d4" subnet_id: "" => "subnet-4b8a3712" aws_route_table_association.private.2: Creation complete aws_route_table_association.private.0: Creation complete aws_route_table_association.private.1: Creation complete aws_instance.postgres.1: Creation complete Error applying plan:

aws_autoscaling_group.consul: diffs didn't match during apply. This is a bug with the resource provider, please report a bug.

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. tennis@tennisMBP: ~/Documents/inf-catalog/terraform (postgres|✗…)

mitchellh commented 9 years ago

Can you reproduce this and run with TF_LOG=1 and attach the debug output please? Thanks!

gamename commented 9 years ago

ok. will do

gamename commented 9 years ago

https://gist.github.com/phinze/527c07732633b355716c

gamename commented 9 years ago

updated. Can't figure out how to clear the "waiting-response" flag - or if I should.

phinze commented 9 years ago

Hey @gamename - just updated your comment to move the debug log into a gist for easier reading :+1:

phinze commented 9 years ago

Notable snippet from the debug log:

-  "vpc_zone_identifier.552724211":*terraform.ResourceAttrDiff{Old:"", New:"74D93920-ED26-11E3-AC10-0800200C9A66,74D93920-ED26-11E3-AC10-0800200C9A66,74D93920-ED26-11E3-AC10-0800200C9A66", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Type:0x0},
+  "vpc_zone_identifier.1236368468":*terraform.ResourceAttrDiff{Old:"", New:"subnet-3ff04c66,subnet-6aa73b1d,subnet-d980c7e3", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Type:0x0},
mitchellh commented 9 years ago

Ah, this is fixed in core. That diff means that a splat is being used at a top level. We now validate against that. :) Can you show me your config @gamename and I can point it out (probably)?

gamename commented 9 years ago

@mitchellh Here's the config with splatting: https://gist.github.com/gamename/21464696d3a26bfc823f

ghost commented 4 years ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.