Commit Graph

24 Commits

Author SHA1 Message Date
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
stack72 87f632cb92
provider/aws: `aws_elasticache_cluster` acceptance test for
`cluster_address`
2016-09-20 17:29:57 +01:00
clint shryock 52f3e9b8db update provider test and extend the delete timelimit 2016-02-04 15:48:54 -06:00
clint shryock 840d2e7ccc Switch to acctest.RandInt for acceptance tests 2016-02-04 11:20:22 -06:00
wata_mac bfcff6b068 Add az_mode and availability_zones parameters
Signed-off-by: wata727 <watassbass@gmail.com>
2016-01-11 23:45:07 +09:00
wata_mac df56ef44f7 Add availability_zone parameter.
Signed-off-by: wata727 <watassbass@gmail.com>
2016-01-11 23:33:21 +09:00
clint shryock 84fe0b15fd provider/aws: Update ElastiCache tests to verify delete
provider/aws: update elasticache search domain to only save access policies if not empty
2015-12-22 10:21:40 -06:00
stack72 2882d01904 Work to allow reducing the Number of Cache Nodes in an ElastiCache Cluster 2015-12-02 21:07:50 +00:00
clint shryock dbd2a43f46 config updates for ElastiCache test 2015-11-06 16:55:04 -06:00
stack72 350f91ec06 Removing the instance_type check in the ElastiCache cluster creation. We now allow the error to bubble up to the userr when the wrong instance type is used. The limitation for t2 instance types now allowing snapshotting is also now documented 2015-11-06 11:16:51 +00:00
stack72 ca2ea80af3 Making the changes to the snapshotting for Elasticache Redis as per @catsby's findings 2015-11-05 12:23:07 +00:00
stack72 707bfd739a Added an extra test for the Elasticache Cluster to show that updates work. Also added some debugging to show that the API returns the Elasticache retention period info 2015-11-03 12:35:24 +00:00
stack72 7dd15469a5 Adding the ability to specify a snapshot window and retention limit for Redis ElastiCache clusters 2015-10-31 00:09:20 +00:00
clint shryock 2cd47ec195 add test for elasticache cluster and topic arn 2015-10-28 14:09:45 -05:00
thrashr888 55f3c8c764 provider/aws: aws_elasticache_cluster normalizes name to lowercase 2015-09-14 16:50:53 -07:00
Clint Shryock 0c2f189d08 provider/aws: Update to aws-sdk 0.9.0 rc1 2015-08-17 13:27:16 -05:00
Mitchell Hashimoto 8748a86e60 Merge pull request #2160 from grubernaut/elasticache_port_required
provider/aws: Set AWS Elasticache Port Number to be required
2015-06-07 22:27:59 -07: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
Clint Shryock a2717acf81 provider/aws: Allow ElastiCache Subnet Group updates
Adds update method for ElastiCache Subnet Groups, things are not all ForceNew
anymore.

- can update description
- can update subnet ids
2015-06-02 11:19:23 -05:00
Jake Champlin b236cdf918 Set AWS Elasticache Port Number to be required
Set Elasticache Port number to not be set by default, and require
Elasticache Port number to be specified.

Also updated acceptance tests to supply port number upon resource
declaration

Fixes #2084
2015-05-31 18:01:07 -04:00
Clint Shryock d81e63cc3c provider/aws: ElastiCache test updates
- rename test to have _basic suffix, so we can run it individually
- use us-east-1 for basic test, since that's probably the only region that has
  Classic
- update the indexing of nodes; cache nodes are 4 digits
2015-05-14 13:57:01 -05:00
Paul Hinze 6f3ce6bf3c WIP export cache nodes
Needs to wait for len(cluster.CacheNodes) == cluster.NumCacheNodes, since
apparently that takes a bit of time and the initial response always has
an empty collection of nodes
2015-05-14 09:16:39 -05:00
Paul Hinze 6c6eafa232 provider/aws: removing stray "Ecache" in tests 2015-05-06 08:33:05 -05:00
Paul Hinze 15b9bde1fe providers/aws: add _cluster to aws_elasticache
This AWS calls the actual resources "Cache Clusters" so it seems like
this name makes more sense.

Verified all Elasticache acc tests pass.
2015-04-30 16:12:08 -05:00