Reputation: 8796
I am running terraform v0.9.6 version on Windows 7. When I run any terraform command I get stuck at the following:
D:\terraforma>terraform destroy
Do you really want to destroy?
Terraform will delete all your managed infrastructure.
There is no undo. Only 'yes' will be accepted to confirm.
Enter a value: yes
There is no output after this for hours. Any pointer as to what could be the issue here? On enabling logging to level debug I get
------------------------
2017/06/01 11:43:56 [DEBUG] plugin: terraform.exe: POST / HTTP/1.1
2017/06/01 11:43:56 [DEBUG] plugin: terraform.exe: Host: sts.amazonaws.com
2017/06/01 11:43:56 [DEBUG] plugin: terraform.exe: User-Agent: aws-sdk-go/1.8.25
(go1.8; windows; amd64) APN/1.0 HashiCorp/1.0 Terraform/0.9.6
2017/06/01 11:43:56 [DEBUG] plugin: terraform.exe: Content-Length: 43
2017/06/01 11:43:56 [DEBUG] plugin: terraform.exe: Authorization: AWS4-HMAC-SHA2
56 Credential=AKIAJ2TUUX4QXSQBD6EA/20170601/us-east-1/sts/aws4_request, SignedHe
aders=content-length;content-type;host;x-amz-date, Signature=dfd1cf69c9c110726ef
be5cfe6aeff5c16437f599e33a5ce5943dd9e04035bb2
2017/06/01 11:43:56 [DEBUG] plugin: terraform.exe: Content-Type: application/x-w
ww-form-urlencoded; charset=utf-8
2017/06/01 11:43:56 [DEBUG] plugin: terraform.exe: X-Amz-Date: 20170601T061356Z
2017/06/01 11:43:56 [DEBUG] plugin: terraform.exe: Accept-Encoding: gzip
2017/06/01 11:43:56 [DEBUG] plugin: terraform.exe:
2017/06/01 11:43:56 [DEBUG] plugin: terraform.exe: Action=GetCallerIdentity&Vers
ion=2011-06-15
2017/06/01 11:43:56 [DEBUG] plugin: terraform.exe: -----------------------------
------------------------
2017/06/01 11:43:59 [DEBUG] dag/walk: vertex "data.aws_ami.ubuntu", waiting for:
"provider.aws"
2017/06/01 11:43:59 [DEBUG] dag/walk: vertex "provider.aws (close)", waiting for
: "data.aws_ami.ubuntu"
2017/06/01 11:43:59 [DEBUG] dag/walk: vertex "root", waiting for: "provider.aws
(close)"
2017/06/01 11:44:04 [DEBUG] dag/walk: vertex "data.aws_ami.ubuntu", waiting for:
"provider.aws"
2017/06/01 11:44:04 [DEBUG] dag/walk: vertex "provider.aws (close)", waiting for
: "data.aws_ami.ubuntu"
2017/06/01 11:44:04 [DEBUG] dag/walk: vertex "root", waiting for: "provider.aws
(close)"
2017/06/01 11:44:09 [DEBUG] dag/walk: vertex "provider.aws (close)", waiting for
: "data.aws_ami.ubuntu"
2017/06/01 11:44:09 [DEBUG] dag/walk: vertex "data.aws_ami.ubuntu", waiting for:
"provider.aws"
2017/06/01 11:44:09 [DEBUG] dag/walk: vertex "root", waiting for: "provider.aws
(close)"
2017/06/01 11:44:14 [DEBUG] dag/walk: vertex "provider.aws (close)", waiting for
: "data.aws_ami.ubuntu"
2017/06/01 11:44:14 [DEBUG] dag/walk: vertex "data.aws_ami.ubuntu", waiting for:
"provider.aws"
2017/06/01 11:44:14 [DEBUG] dag/walk: vertex "root", waiting for: "provider.aws
(close)"
Upvotes: 2
Views: 8024
Reputation: 180
Upgrading from version 0.9.6
to version 0.10.6
fixed this exact problem for me.
Upvotes: 0
Reputation: 4757
This is a known issue with older versions of terraform where it hangs and loops forever if the AWS provider does some background checks and tries to connect to the metadata ip 169.254.169.254:80 source code reference before it moves on with further steps
To fix, you can add a rule to drop connection to 169.254.0.0/16
and it should work
it also advisable you upgrade to the latest stable version 0.9.8 (released: June 7, 2017)
See https://github.com/hashicorp/terraform/issues/4043#issuecomment-161608689
Version releases Changelog: https://github.com/hashicorp/terraform/blob/master/CHANGELOG.md
Upvotes: 2