Commit Graph

21 Commits

Author SHA1 Message Date
stack72 feaabb6ca1
provider/aws: Do not set empty string to state for `aws_vpn_gateway`
availability zone

Fixes #4752

According to the AWS Documentation, when `describing-vpn-gateways`

```
AvailabilityZone -> (string)
The Availability Zone where the virtual private gateway was created, if applicable. This field may be empty or not returned.
```

Therefore, if we pass an availability zone as part of vpn gateway, then it may come back as an empty string. If we set this empty string back to state, then the next plan will look as follows:

```
-/+ aws_vpn_gateway.vpn_gateway
    availability_zone: "" => "us-west-2a" (forces new resource)
    tags.%:            "1" => "1"
    tags.Name:         "vpn-us-west-2" => "vpn-us-west-2"
    vpc_id:            "vpc-1e9da47a" => "vpc-1e9da47a"

Plan: 1 to add, 0 to change, 1 to destroy.
```

If the availability_zone comes back from AWS as an empty string, then we should not set it to state to avoid forcing a new resource for the user

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSVpnGateway_withAvailabilityZoneSetToState'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/09/03 17:10:57 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSVpnGateway_withAvailabilityZoneSetToState -timeout 120m
=== RUN   TestAccAWSVpnGateway_withAvailabilityZoneSetToState
--- FAIL: TestAccAWSVpnGateway_withAvailabilityZoneSetToState (36.11s)
       	testing.go:265: Step 0 error: Check failed: Check 2/2 error: aws_vpn_gateway.foo: Attribute 'availability_zone' expected "us-west-2a", got ""
FAIL
exit status 1
FAIL   	github.com/hashicorp/terraform/builtin/providers/aws   	36.130s
make: *** [testacc] Error 1
[stacko@Pauls-MacBook-Pro:~/Code/go/src/github.com/hashicorp/terraform on master]
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSVpnGateway_withAvailabilityZoneSetToState'                                                                                       2 ↵ ✹
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/09/03 17:12:25 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSVpnGateway_withAvailabilityZoneSetToState -timeout 120m
=== RUN   TestAccAWSVpnGateway_withAvailabilityZoneSetToState
--- PASS: TestAccAWSVpnGateway_withAvailabilityZoneSetToState (46.50s)
PASS
ok     	github.com/hashicorp/terraform/builtin/providers/aws   	46.517s
```
2016-09-03 17:14:42 +03:00
clint shryock 03bdf1375e provider/aws: Clear up test failure for TestAccAWSVpnGateway_disappears 2016-08-22 14:56:07 -05:00
Paul Stack 4de4590147 provider/aws: Adds acceptance tests for `aws_gateway_*` manual deletions causing non-empty plans (#7879)
* provider/aws: Adds an acceptance test that makes sure that  manual deletions mean a non-empty plan

* provider/aws: Adds an acceptance test to prove that  manual deletion causes a non-empty plan
2016-08-16 20:42:06 +01:00
Krzysztof Wilczynski 9c54e9c955 Add aws_vpn_gateway_attachment resource. (#7870)
This commit adds VPN Gateway attachment resource, and also an initial tests and
documentation stubs.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
2016-08-07 09:29:51 +10:00
Modestas Vainius e655cbd0fc provider/aws: Fix reattachment of VPC to VPN gateway.
When VPC is detached from VPN gateway, its VpcAttachment stays in place
just with state changed to "detached". Since terraform was not checking
attachment state, it used to think VPC gateway was still attached.
2016-06-02 20:35:33 +03:00
Mitchell Hashimoto c682dece84
providers/aws/vpn_gateway id-only refresh 2016-04-20 12:41:20 -07:00
clint shryock 055482a9f5 providers/aws: Update VPN Gateway test 2016-01-05 16:16:32 -06:00
Clint Shryock 0c2f189d08 provider/aws: Update to aws-sdk 0.9.0 rc1 2015-08-17 13:27:16 -05:00
Clint Shryock 3688d4ba00 provider/aws: Converge on TestAccAWS for acceptance tests names
An attempt to converge the tests into a standard naming scheme

- TestAccAWS for aws tests
- a `_basic` test for each suite, save a few that are quick (Network ACLs, for
  example)
2015-07-21 09:42:02 -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
Mitchell Hashimoto b184e283b9 provider/aws: detach VPN gateway with proper ID 2015-05-06 09:45:08 -07:00
Clint Shryock ba43b7c963 mass search-replace of ec2SDKconn 2015-04-16 15:05:55 -05:00
Clint Shryock dc54d6a852 refactor out a refresh fun that wasn't really used 2015-04-15 10:26:39 -05:00
Clint Shryock 900dd4e151 provider/aws: Convert VPN Gateway to upstream 2015-04-14 15:45:48 -05:00
Dan Everton 8ebbaf550c Fixes for goamz removal. 2015-03-19 11:14:41 +10:00
Dan Everton d6a731040c Format the resource_vpn_gateway*.go files. 2015-03-10 10:30:42 +10:00
Dan Everton 7240af439c Minor test fixes. 2015-03-06 15:48:30 +10:00
Dan Everton 98d827b6f5 Match the internet gateway code better. 2015-03-06 08:47:29 +10:00
Dan Everton 4706ee7ffc Add acceptance test for aws_vpn_gateway resource. 2015-03-06 08:41:22 +10:00