terraform/builtin/providers
Paul Stack 1eeb3c41e3 provider/aws: Allow AWS Subnet to change IPv6 CIDR Block without ForceNew (#13909)
Fixes: #13588

It was pointed out in #13588 that we don't need to ForceNew on a change
of IPv6 CIDR block. The logic I decided to implement here was to
disassociate then associate. We should only be able to be associated to
1 IPv6 CIDR block at once. This feels like a risky move. We can
disassociate and then error on the associate. This would leave us in a
situation where we have no IPv6 CIDR block associated

The alternative here would be that the failure of association, triggers
a reassociation with the old IPv6 CIDR block

I added a test to make sure that the subnet Ids don't change as the ipv6
block changes. Before removing the ForceNew from the ipv6_cidr_block,
the test results in the following:

```
=== RUN   TestAccAWSSubnet_ipv6
--- FAIL: TestAccAWSSubnet_ipv6 (92.09s)
	resource_aws_subnet_test.go:105: Expected SubnetIDs not to change, but both got before: subnet-0d2b6a6a and after: subnet-742c6d13
```

After the removal of ForceNew, the test result looks as follows:

```
=== RUN   TestAccAWSSubnet_ipv6
--- PASS: TestAccAWSSubnet_ipv6 (188.34s)
```

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSSubnet_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/04/24 21:26:36 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSubnet_ -timeout 120m
=== RUN   TestAccAWSSubnet_importBasic
--- PASS: TestAccAWSSubnet_importBasic (85.63s)
=== RUN   TestAccAWSSubnet_basic
--- PASS: TestAccAWSSubnet_basic (80.28s)
=== RUN   TestAccAWSSubnet_ipv6
--- PASS: TestAccAWSSubnet_ipv6 (188.34s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	354.283s
```
2017-04-24 23:39:28 +03:00
..
alicloud provider/alicloud: Add new resource ESS, including scalinggroup scalingconfiguration scalingrule and schedule (#13731) 2017-04-18 15:18:57 +03:00
archive
arukas
atlas Add VersionString 2016-07-21 16:43:49 -04:00
aws provider/aws: Allow AWS Subnet to change IPv6 CIDR Block without ForceNew (#13909) 2017-04-24 23:39:28 +03:00
azure
azurerm Comment explaning why we can have deleted resources in the state 2017-04-24 15:35:59 +01:00
bitbucket Refactoring of bitbucket provider with betters. 2017-04-05 12:09:43 -07:00
chef
circonus provider/circonus: Remove ValidateFunc from Computed-only field 2017-04-23 12:40:17 +02:00
clc
cloudflare
cloudstack provider/cloudstack: do not force a new resource when updating load balancer members (#11786) 2017-04-05 15:34:35 +02:00
cobbler
consul provider/consul: Remove ValidateFunc from Computed-only fields 2017-04-23 12:40:58 +02:00
datadog datadog: Fix incorrect schema of monitor for 'silenced' (#12720) 2017-03-15 15:01:49 +00:00
digitalocean provider/digitaocean: Test that droplets are indempotent (#13883) 2017-04-24 21:43:27 +03:00
dme
dns provider/dns: update hard-coded DNS result in acctests 2017-04-07 17:04:55 -07:00
dnsimple provider/dnsimple: Handle 404 on DNSimple records (#13131) 2017-04-12 20:49:04 +02:00
docker
dyn
external
fastly provider/fastly: GCS (#13553) 2017-04-21 19:44:25 +03:00
github Clears branch protection from state only if error is an HTTP 404 (#13887) 2017-04-24 18:19:27 +01:00
google provider/google: Make ports in resource_compute_forwarding_rule ForceNew (#13833) 2017-04-21 20:47:02 +03:00
grafana
heroku
icinga2
ignition
influxdb
kubernetes provider/kubernetes: Add support for persistent_volume_claim (#13527) 2017-04-12 08:33:26 +01:00
librato
local provider/local: Implement a new local_file resource 2017-04-13 14:57:29 -07:00
logentries provider/logentries: Refresh from state when resources not found (#13810) 2017-04-20 21:38:37 +03:00
mailgun builtin: Refactor resource.Retry to clarify return 2016-03-09 17:37:56 -06:00
mysql
newrelic Update go-newrelic vendor and use new field (#13158) 2017-04-17 01:59:11 +03:00
nomad
ns1 provider/ns1: record documentation improvements (#13786) 2017-04-21 12:38:05 +03:00
null
oneandone Provider Oneandone (#13633) 2017-04-21 17:19:10 +03:00
opc provider/opc: Fix Instance Label / Update Docs 2017-04-21 10:09:26 -04:00
openstack provider/openstack: Ignore fixed_ip when importing ports (#13563) 2017-04-17 01:36:15 +03:00
opsgenie
packet
pagerduty
postgresql fix wrong usage of hashicorp/errwrap (#11500) 2017-01-29 19:19:48 +00:00
powerdns
profitbricks
rabbitmq provider/rabbitmq: Add test for binding properties_key (#13797) 2017-04-21 20:01:46 +03:00
rancher provider/rancher: Remove DiffSuppressFunc from Computed-only fields 2017-04-23 12:41:18 +02:00
random
rundeck
scaleway provider/scaleway: improve schema resources (#13522) 2017-04-11 11:10:45 +03:00
softlayer Added softlayer virtual guest and ssh keys functionality: 2016-05-03 15:58:58 -05:00
spotinst
statuscake Add support for StatusCake trigger rate 2017-04-10 15:38:26 +03:00
template Fix invalid MIME formatting in multipart cloudinit userdata (#13752) 2017-04-21 08:30:09 +02:00
terraform
test
tls
triton Fixes TestAccTritonMachine_addNIC and TestAccTritonMachine_nic 2017-04-11 15:10:13 -06:00
ultradns resourceUltradnsRdpoolRead set rdata 2017-04-18 15:08:18 +00:00
vault Merge #11776: Optionally allow vault_generic_secret resource to detect drift 2017-04-17 11:14:02 -07:00
vcd provider/vcd: Updated dependencies to use ukcloud/govcloudair (#11535) 2017-01-31 11:11:06 +00:00
vsphere