Commit Graph

12920 Commits

Author SHA1 Message Date
Paul Stack b6718de299 Merge pull request #9010 from hashicorp/aws-elasticache-cluster-import
Aws elasticache cluster import
2016-09-28 19:49:42 +01:00
Mickaël Canévet 1521517068 network_id is computed (#9102) 2016-09-28 17:35:37 +02:00
stack72 b02a5c47ec
provider/aws: Support Import of aws_elasticache_cluster
Initial tests were failing as follows:

```
=== RUN   TestAccAWSElasticacheCluster_importBasic
--- FAIL: TestAccAWSElasticacheCluster_importBasic (362.66s)
        testing.go:265: Step 1 error: ImportStateVerify attributes not
        equivalent. Difference is shown below. Top is actual, bottom is
        expected.

        (map[string]string) {

        }

(map[string]string) (len=2) {
             (string) (len=20) "parameter_group_name": (string) (len=20)
             "default.memcached1.4",
                             (string) (len=22) "security_group_names.#":
                             (string) (len=1) "0"

}

FAIL
exit status 1
```

The import of ElastiCache clusters helped to point out 3 things:

1. Currently, we were trying to set the parameter_group_name as follows:

```
d.Set("parameter_group_name", c.CacheParameterGroup)
```

Unfortunately, c.CacheParameterGroup is a struct not a string. This was
causing the test import failure. So this had to be replaced as follows:

```
if c.CacheParameterGroup != nil {
      d.Set("parameter_group_name", c.CacheParameterGroup.CacheParameterGroupName)
}
```

2. We were trying to set the security_group_names as follows:

```
d.Set("security_group_names", c.CacheSecurityGroups)
```

The CacheSecurityGroups was actually a []* so had to be changed to work
as follows:

```
if len(c.CacheSecurityGroups) > 0 {
            d.Set("security_group_names",
            flattenElastiCacheSecurityGroupNames(c.CacheSecurityGroups))

}
```

3. We were trying to set the security_group_ids as follows:

```
d.Set("security_group_ids", c.SecurityGroups)
```

This is another []* and needs to be changed as follows:

```
if len(c.SecurityGroups) > 0 {
            d.Set("security_group_ids",
            flattenElastiCacheSecurityGroupIds(c.SecurityGroups))

}
```

This then allows the import test to pass as expected:

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSElasticacheCluster_importBasic'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/09/23 10:59:01 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSElasticacheCluster_importBasic -timeout 120m
=== RUN   TestAccAWSElasticacheCluster_importBasic
--- PASS: TestAccAWSElasticacheCluster_importBasic (351.96s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    351.981s
```

As a final test, I ran the basic ElastiCache cluster creation to make
sure all passed as expected:

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSElasticacheCluster_basic'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/09/23 11:05:51 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSElasticacheCluster_basic -timeout 120m
=== RUN   TestAccAWSElasticacheCluster_basic
--- PASS: TestAccAWSElasticacheCluster_basic (809.25s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    809.267s
```
2016-09-28 12:29:20 +01:00
Paul Stack 032e7dfc9d Update CHANGELOG.md 2016-09-28 11:19:04 +01:00
Paul Stack d4dd615b52 Merge pull request #9052 from hashicorp/b-aws-rds-option-group
provider/aws: aws_db_option_group flattenOptions failing due to missing values
2016-09-28 11:18:28 +01:00
stack72 df8ca94093
provider/aws: aws_db_option_group flattenOptions failing due to missing
values

Fixes #8332

Not all option_group parameters have values. For example, when you
enable the MariaDB option_group, some of the settings have empty values
(see screenshot)

This PR adds a safety net on reading those values back to the statefile

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSDBOptionGroup_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/09/26 13:55:21 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSDBOptionGroup_ -timeout 120m
=== RUN   TestAccAWSDBOptionGroup_importBasic
--- PASS: TestAccAWSDBOptionGroup_importBasic (20.12s)
=== RUN   TestAccAWSDBOptionGroup_basic
--- PASS: TestAccAWSDBOptionGroup_basic (18.45s)
=== RUN   TestAccAWSDBOptionGroup_basicDestroyWithInstance
--- PASS: TestAccAWSDBOptionGroup_basicDestroyWithInstance (597.90s)
=== RUN   TestAccAWSDBOptionGroup_OptionSettings
--- PASS: TestAccAWSDBOptionGroup_OptionSettings (33.27s)
=== RUN   TestAccAWSDBOptionGroup_sqlServerOptionsUpdate
--- PASS: TestAccAWSDBOptionGroup_sqlServerOptionsUpdate (33.39s)
=== RUN   TestAccAWSDBOptionGroup_multipleOptions
--- PASS: TestAccAWSDBOptionGroup_multipleOptions (19.87s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    723.037s
```
2016-09-28 11:06:40 +01:00
Paul Stack 52761701e1 Update CHANGELOG.md 2016-09-28 11:03:52 +01:00
Paul Stack bf5039311b Merge pull request #9049 from hashicorp/b-aws-r53-record-delete
provider/aws: guard against aws_route53_record delete panic
2016-09-28 11:02:03 +01:00
clint shryock 2c7d4faf53 provider/google: remove debug spew statement 2016-09-27 17:06:41 -05:00
Seth Vargo 376f0827a3 Merge pull request #9085 from hashicorp/sethvargo/docsbg
Fix rabbitmq docs background
2016-09-27 13:24:43 -07:00
Seth Vargo 8edd0ae2b1
Fix rabbitmq docs background
Refs: https://twitter.com/Jippi/status/780860130468528128
2016-09-27 13:12:07 -07:00
Paul Stack f6ff349d6d Merge pull request #8971 from BedeGaming/azurerm-sdk-4
provider/azurerm: update Azure SDK
2016-09-27 18:58:08 +01:00
Paul Stack 060160c4fe Update CHANGELOG.md 2016-09-27 18:02:11 +01:00
Paul Stack 1cf9f41510 Merge pull request #9038 from kwilczynski/feature/error-reporting-aws_vpc_peering_connection
provider/aws: Make sure that VPC Peering Connection in a failed state returns an error.
2016-09-27 17:56:54 +01:00
Joe Topjian b60e1c73bb Update CHANGELOG.md 2016-09-27 09:23:08 -04:00
Joe Topjian 1e85d21dc4 Merge pull request #8948 from jfpucheu/PATCH_8735
Correct Proxy setting for openstack provider: issue 8735
2016-09-27 09:21:33 -04:00
Paul Stack c3158243ee Merge pull request #9071 from optimisticanshul/patch-1
Fix docs aws_instance
2016-09-27 09:05:36 +01:00
Paul Stack b7bf74b619 Update CHANGELOG.md 2016-09-27 08:58:38 +01:00
Paul Stack 3840ff0f40 Merge pull request #8947 from dagnello/vsphere-vm-disks-detach
vSphere: Adding 'detach_unknown_disks_on_delete' flag for VM resource
2016-09-27 08:56:58 +01:00
Anshul Sharma 1d443e87bc Fix docs
Fixes #8714
2016-09-27 13:26:15 +05:30
Davide Agnello dfe1cacc9e Adding 'detach_unknown_disks_on_delete' flag for VM resource
Optional, defaults to false.  If true, will detach disks not managed by
Terraform VM resource prior to VM deletion.

Issue: #8945
2016-09-26 18:16:02 -07:00
Paul Stack 0974250412 Merge pull request #9063 from TimeIncOSS/b-aurora-encryption-docs
aws: Fix docs after changing Aurora instance schema
2016-09-26 22:51:42 +01:00
Radek Simko ac7f551155
aws: Fix docs after changing Aurora instance schema 2016-09-26 20:50:20 +01:00
hanks e12f42a8b5 remove `description` section in Argument Reference of AWS_DEFAULT_SECURITY_GROUP,
because do not support description field according to the source code.
2016-09-26 13:55:57 -05:00
Paul Stack d4e6de3a4c Update CHANGELOG.md 2016-09-26 19:45:37 +01:00
Paul Stack bdb915693b Merge pull request #9060 from TimeIncOSS/b-aws-aurora-encryption
provider/aws: Make encryption in Aurora instances computed-only
2016-09-26 19:44:36 +01:00
Paul Stack a1ccbda2cc Merge pull request #9058 from hashicorp/sethvargo/update_hashicorp
Update middleman-hashicorp
2016-09-26 18:00:51 +01:00
Seth Vargo 912b97ffa9
Update middleman-hashicorp 2016-09-26 11:33:00 -05:00
Radek Simko de03308b73
provider/aws: Make encryption in Aurora instances computed-only 2016-09-26 17:23:16 +01:00
Paul Stack fdcb3c2aa3 Update CHANGELOG.md 2016-09-26 17:17:12 +01:00
Paul Stack b1f8965da2 Merge pull request #9056 from hashicorp/b-aws-eip-assoc-refresh
provider/aws: Refresh AWS EIP association from state when not found
2016-09-26 17:16:25 +01:00
stack72 054f46b1f9
provider/aws: Refresh AWS EIP association from state when not found
Fixes #6758

We used to throw an error when this was the case - we should refresh
from state so the association can be recreated

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSEIPAssociation_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/09/26 16:42:37 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSEIPAssociation_ -timeout 120m
=== RUN   TestAccAWSEIPAssociation_basic
--- PASS: TestAccAWSEIPAssociation_basic (272.92s)
=== RUN   TestAccAWSEIPAssociation_disappears
--- PASS: TestAccAWSEIPAssociation_disappears (119.62s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws392.559s
```
2016-09-26 16:50:51 +01:00
Paul Stack 14f5833aed Update CHANGELOG.md 2016-09-26 12:03:10 +01:00
Paul Stack a77d55c919 Merge pull request #8806 from optimisticanshul/8793-snapshot-identifier
Changing snapshot_identifier on aws_db_instance resource should force…
2016-09-26 12:01:47 +01:00
stack72 a367f3550f
provider/aws: guard against aws_route53_record delete panic
Fixes #9025

We were assuming there would always be a changeInfo record and then
dereferencing the ID. This wasn't always the case (As noted in #9025)
where it was a delete rather than a delete / create action

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSRoute53Record_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/09/26 11:26:43 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSRoute53Record_ -timeout 120m
=== RUN   TestAccAWSRoute53Record_basic
--- PASS: TestAccAWSRoute53Record_basic (114.99s)
=== RUN   TestAccAWSRoute53Record_basic_fqdn
--- PASS: TestAccAWSRoute53Record_basic_fqdn (126.64s)
=== RUN   TestAccAWSRoute53Record_txtSupport
--- PASS: TestAccAWSRoute53Record_txtSupport (113.25s)
=== RUN   TestAccAWSRoute53Record_spfSupport
--- PASS: TestAccAWSRoute53Record_spfSupport (112.89s)
=== RUN   TestAccAWSRoute53Record_generatesSuffix
--- PASS: TestAccAWSRoute53Record_generatesSuffix (113.29s)
=== RUN   TestAccAWSRoute53Record_wildcard
--- PASS: TestAccAWSRoute53Record_wildcard (163.05s)
=== RUN   TestAccAWSRoute53Record_failover
--- PASS: TestAccAWSRoute53Record_failover (121.15s)
=== RUN   TestAccAWSRoute53Record_weighted_basic
--- PASS: TestAccAWSRoute53Record_weighted_basic (117.06s)
=== RUN   TestAccAWSRoute53Record_alias
--- PASS: TestAccAWSRoute53Record_alias (116.97s)
=== RUN   TestAccAWSRoute53Record_s3_alias
--- PASS: TestAccAWSRoute53Record_s3_alias (138.79s)
=== RUN   TestAccAWSRoute53Record_weighted_alias
--- PASS: TestAccAWSRoute53Record_weighted_alias (241.48s)
=== RUN   TestAccAWSRoute53Record_geolocation_basic
--- PASS: TestAccAWSRoute53Record_geolocation_basic (132.51s)
=== RUN   TestAccAWSRoute53Record_latency_basic
--- PASS: TestAccAWSRoute53Record_latency_basic (121.29s)
=== RUN   TestAccAWSRoute53Record_TypeChange
--- PASS: TestAccAWSRoute53Record_TypeChange (189.31s)
=== RUN   TestAccAWSRoute53Record_empty
--- PASS: TestAccAWSRoute53Record_empty (127.31s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws
2050.012s
```
2016-09-26 11:27:56 +01:00
Paul Stack 702c3261b4 Update CHANGELOG.md 2016-09-26 09:30:20 +01:00
Paul Stack 01cef1a63c Merge pull request #9029 from hashicorp/b-cloudwatch-dimensions-read
provider/aws: Fix reading dimensions on cloudwatch alarms
2016-09-26 09:29:27 +01:00
Krzysztof Wilczynski a2a2de5db2
Add test to check for failed state of the VPC Peering Connection.
Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
2016-09-26 09:17:24 +01:00
James Nugent 1464c8538d Merge pull request #9041 from gepser/master
Fixing broken link and fixing the readme for the digitalocean example
2016-09-25 18:27:43 -05:00
Gepser Hoil 213e89277d Merge pull request #1 from gepser/brokenlinkdo
Fixing broken link and fixing the readme for the digitalocean example
2016-09-25 17:24:35 -06:00
Gepser Hoil 4906440f13 Fixing broken link and fixing the readme for the digitalocean example 2016-09-25 17:22:13 -06:00
Krzysztof Wilczynski a58650c980
Make sure that VPC Peering Connection in a failed state returns an error.
This commit adds simple logic which allows for a VPC Peering Connection
that is in a failed state (e.g. due to an overlapping IP address ranges,
etc.), to report such failed state as an error, rather then waiting for
the time out to occur.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
2016-09-25 15:50:08 +01:00
Evan Brown 0edb68ef5a Merge pull request #8977 from sl1pm4t/b-gcs-storage-class
provider/google: Add support for GCS StorageClass
2016-09-24 21:13:17 -07:00
Martin Atkins 7d2b51e6c5 Merge #9033: Fix crash in aws_ami data source with name_regex 2016-09-24 08:27:57 -07:00
Krzysztof Wilczynski 5af8c8080a
Fix. Handle missing AMI name when matching against image name.
This commit fixes the issues where in a very rare cases the Amazon Machine
Image (AMI) would not have an image name set causing regular expression match
to fail with a nil pointer dereference. Also, the logic of if-else statements
was simplified (reduced branching since return is used a lot).

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
2016-09-24 14:34:00 +01:00
Paul Stack 3a3a424479 Update CHANGELOG.md 2016-09-24 10:27:06 +01:00
Paul Stack 979af97b52 Merge pull request #9031 from kjmkznr/b-aws-s3-lifecycle
provider/aws: Fix failed remove S3 lifecycle_rule
2016-09-24 10:26:18 +01:00
Paul Stack 07edf65337 Update CHANGELOG.md 2016-09-24 09:56:43 +01:00
Paul Stack 464ea2d12a Merge pull request #9032 from AlexanderEkdahl/master
Corrected Seoul S3 Website Endpoint
2016-09-24 09:55:29 +01:00
Alexander Ekdahl d2861be48e Corrected Seoul S3 Website Endpoint 2016-09-24 17:43:58 +09:00