Commit Graph

50 Commits

Author SHA1 Message Date
Paul Stack 2b0de3ca5c Merge pull request #8454 from Originate/mb-fix-internet-gateway-deletion
provider/aws: Skip detaching when aws_internet_gateway not found
2016-09-04 00:55:37 +03:00
Clint 740b8bb9cb provider/aws: Run errcheck in tests (#8579)
* provider/aws: Add errcheck to Makefile, error on unchecked errors

* more exceptions

* updates for errcheck to pass

* reformat and spilt out the ignore statements

* narrow down ignores

* fix typo, only ignore Close and Write, instead of close or write
2016-09-02 09:24:17 -05:00
Maxime Bury 39bc60c3dc Retry on gateway not found 2016-08-24 13:17:45 -04:00
Carlos Sanchez e3b7760af4 [AWS] Retry AttachInternetGateway and increase timeout (#7891) 2016-08-08 13:30:14 +12:00
David Tolnay a86d766bd2 provider/aws: internetgateway timing tweaks (again) (#7447)
This workaround is originally from 71b30c633f.
According to the commit message from Mitchell Hashimoto:

    So I think the AWS API is just broken here. In the case that the state
    doesn't update, just assume it did after 5 seconds.

Based on my experience, this AWS API is still broken in the same way.

The timeout was later increased from 5 seconds to 10 seconds in
265cc4fffa.

The timeout (but not the timer) was removed inexplicably in GH-1325.

The symptom is this error from `terraform apply`:

    aws_internet_gateway.test: Error waiting for internet gateway (igw-553b4731) to attach: timeout while waiting for state to become '[available]'

followed by all subsequent `terraform apply` commands failing with this error:

    aws_internet_gateway.test: Resource.AlreadyAssociated: resource igw-553b4731 is already attached to network vpc-61bc7606
2016-07-07 15:45:28 -05:00
Mitchell Hashimoto 884980da1a
providers/aws: instance, nat, internet gateway 2016-05-16 10:03:57 -07:00
Carlos Sanchez 32bd25d743 Issue #2174 Check that InternetGateway exists before returning from creation (#6105)
* Issue #2174 Check that InternetGateway exists before returning from creation

Fix some random InvalidInternetGatewayID.NotFound errors

* Issue #2174 Reuse IGStateRefreshFunc

* Issue #2174 Need to wait for creation before setting tags
2016-04-13 09:28:17 -05:00
Paul Hinze 108ccf0007 builtin: Refactor resource.Retry to clarify return
Change the `RetryFunc` from a plain `error` return type to a
specialized `RetryError` which must decide whether it is
retryable or not.

Add `RetryableError` / `NonRetryableError` factory functions that
callers are meant to use to build up these errors.

This makes it eminently clear whether or not a given error is
retryable from inside the client code.

Goal here is to _not_ change any behavior, simply reflect the
existing behavior with the new, clearer, API.
2016-03-09 17:37:56 -06:00
Chris Marchesi c24fbc3f24 IGW detatch waiter tweak, 30 not found checks w/15 min max 2016-02-12 17:31:49 -08:00
Ian Duffy 47ac10d66b Change resource.StateChangeConf to use an array for target states
Signed-off-by: Ian Duffy <ian@ianduffy.ie>
2016-01-21 01:20:41 +00:00
Clint Shryock 0c2f189d08 provider/aws: Update to aws-sdk 0.9.0 rc1 2015-08-17 13:27:16 -05:00
Katelyn Perry 6fbebe3172 provider/aws: bump internet gateway detach timeout 2015-07-09 10:42:16 -05:00
Paul Hinze b71fa3d0ae provider/aws: handle upstream aws-sdk-go repo move
`awslabs/aws-sdk-go => aws/aws-sdk-go`

Congrats to upstream on the promotion. :)
2015-06-03 13:36:57 -05:00
Paul Hinze 31258e06c6 provider/aws: fix breakages from awserr refactor
This landed in aws-sdk-go yesterday, breaking the AWS provider in many places:

3c259c9586

Here, with much sedding, grepping, and manual massaging, we attempt to
catch Terraform up to the new `awserr.Error` interface world.
2015-05-20 06:21:23 -05:00
Clint Shryock f7b6b6b2b5 Strip 'sdk' suffix from methods; it's a remnant 2015-05-12 14:58:10 -05:00
Clint Shryock ba43b7c963 mass search-replace of ec2SDKconn 2015-04-16 15:05:55 -05:00
Clint Shryock 2c1c448031 providers/aws: Convert AWS Internet gateway to upstream aws-sdk-go 2015-04-07 09:44:00 -05:00
Clint Shryock 043a4848ee provider/aws: Fix dependency violation when deleting Internet Gateways 2015-03-27 11:39:07 -05:00
Clint Shryock 28fbd971fc Retire goamz 2015-03-13 09:42:50 -05:00
Clint Shryock 57556bba75 Replace tags files with tags_sdk, rename, and update 2015-03-12 16:43:08 -05:00
Radek Simko c7ccf4f74d Bugfix: Add tags on AWS IG creation, not just on update 2015-03-10 23:01:05 +00:00
Clint Shryock 89d6cdb0a6 providers/aws: Convert AWS Internet Gateway to aws-sdk-go 2015-03-03 16:08:52 -06:00
Radek Simko e149a97658 Make composite literals to use keyed fields
This will prevent following error:
 - * composite literal uses unkeyed fields
2015-02-18 18:26:59 +00:00
Mitchell Hashimoto 08813e6571 Merge branch 'add-ig-tags' of https://github.com/robzienert/terraform into robzienert-add-ig-tags
Conflicts:
	builtin/providers/aws/resource_aws_internet_gateway_test.go
2015-01-10 15:28:14 -08:00
Emil Hessman c738bf0477 builtin/providers/aws: remove unreachable code and skip unnecessary remote call
When DeleteInternetGateway is successful it returns a nil error value.
However, for a nil error value, the RetryFunc returns an error yielding a
unnecessary second call to DeleteInternetGateway in the retry logic.

The logic works because DeleteInternetGateway eventually returns an ec2.Error
with error code InvalidInternetGatewayID.NotFound since the internet gateway
has been deleted in the previous call. The return value of nil breaks the
retry logic and the deletion is deemed successful.

Fix the unnecessary second call to DeleteInternetGateway by short circuiting
with a nil error value when deletion of the internet gateway is successful on
the first try.

Add an acceptance test for internet gateway deletion and remove unreachable
code while here.
2015-01-03 21:56:44 +01:00
Rob Zienert 9fd59f09e2 Adding tags support to Internet Gateway resource 2014-12-27 22:05:15 -06:00
Armon Dadgar 6098809ec5 Merge pull request #665 from gosuri/master
Fix for #664, crashed due to ig.Attachements being 0
2014-12-14 18:15:27 -08:00
Greg Osuri 9b9d147585 Setting the VPC id to blank for unattached igws 2014-12-14 14:05:38 -08:00
Sander van Harmelen 27a97c4498 Small gofmt update... 2014-12-14 12:32:17 +01:00
Sander van Harmelen d9af954c60 provider/aws: fixing the aws_internet_gateway resource
The resource is build so it can attach and detach the Internet Gateway
from a VPC, but as the schema has `Required` and `ForceNew` both set
to `true` for the vpc_id field it will never use these capabilities.
2014-12-14 12:20:59 +01:00
Greg Osuri 3883e47902 Fix for #664, crashed due to ig.Attachements being 0 2014-12-13 22:14:23 -08:00
Sander van Harmelen eccd5ad308 Refactored about 90%
Still need to update 2 resources and check the acceptance tests, but
overall we’re nearly there 😃
2014-11-21 17:58:34 +01:00
Panagiotis Moustafellos f240c27e16 providers/aws: retry destroying internet gateway for some time [GH-447] 2014-10-18 11:47:33 +03:00
Mitchell Hashimoto 9b2b3a963f ResourceDiff => InstanceDiff 2014-09-17 16:33:24 -07:00
Mitchell Hashimoto c5d6df692d providers/aws: tests passing, compiles 2014-09-16 17:49:24 -07:00
Mitchell Hashimoto 56cf1e6faa Fix go vet complaints 2014-08-24 21:50:35 -07:00
Mitchell Hashimoto bd2fe4d145 providers/aws: return proper internet gateway when attach fails 2014-07-13 11:16:59 -07:00
Mitchell Hashimoto 9afebeb07e providers/aws: route table tests 2014-07-10 15:52:56 -07:00
Mitchell Hashimoto 265cc4fffa providers/aws: extend InternetGateway timeout to be safe 2014-07-10 15:35:41 -07:00
Mitchell Hashimoto 71b30c633f providers/aws: internetgateway timing tweaks
So I think the AWS API is just broken here. In the case that the state
doesn't update, just assume it did after 5 seconds.
2014-07-10 15:33:50 -07:00
Mitchell Hashimoto a46cafc975 providers/aws: internet gateway is more robust 2014-07-09 09:16:47 -07:00
Mitchell Hashimoto 66c716540f providers/aws: internet gateway delete is more flexible 2014-07-08 16:05:08 -07:00
Mitchell Hashimoto 5bec1ac383 providers/aws: gateway detach is idempotent 2014-07-08 16:02:01 -07:00
Mitchell Hashimoto f7b7c30055 providers/aws: internet gateway belongs to VPC 2014-07-07 21:03:53 -07:00
Mitchell Hashimoto c0dbb8febd providers/aws: much better logic for attaching/detaching internet gateways 2014-07-07 21:00:46 -07:00
Mitchell Hashimoto 037bed71ed providers/aws: support attaching/detaching internet gateway 2014-07-07 20:51:45 -07:00
Mitchell Hashimoto bdc2a53c9d providers/aws: style 2014-07-07 17:12:22 -07:00
Mitchell Hashimoto e33739209b providers/aws: its okay to delete something that is already gone 2014-07-07 17:09:05 -07:00
Mitchell Hashimoto 5b95271819 providers/aws: clean up internet gateway code 2014-07-07 16:14:08 -07:00
Mitchell Hashimoto 42e999923a providers/aws: aws_internet_gateway 2014-07-07 16:12:03 -07:00