provider/aws: `aws_elasticache_replication_groups` only support Redis (#8297)

* provider/aws: `aws_elasticache_replication_groups` only support Redis

therefore, making our users add `engine = redis` to the configuration
felt wasted

* Update resource_aws_elasticache_replication_group.go

* Update resource_aws_elasticache_replication_group.go

* Update resource_aws_elasticache_replication_group.go

* Update resource_aws_elasticache_replication_group_test.go

* Update resource_aws_elasticache_replication_group_test.go

* Update resource_aws_elasticache_replication_group.go
This commit is contained in:
Paul Stack 2016-08-18 20:30:12 +01:00 committed by GitHub
parent c8a9c068a2
commit 09de4f82ce
3 changed files with 5 additions and 10 deletions

View File

@ -42,6 +42,9 @@ func resourceAwsElasticacheReplicationGroup() *schema.Resource {
ForceNew: true,
}
resourceSchema["engine"].Required = false
resourceSchema["engine"].Optional = true
resourceSchema["engine"].Default = "redis"
resourceSchema["engine"].ValidateFunc = validateAwsElastiCacheReplicationGroupEngine
return &schema.Resource{
@ -396,7 +399,6 @@ func validateAwsElastiCacheReplicationGroupEngine(v interface{}, k string) (ws [
if strings.ToLower(v.(string)) != "redis" {
errors = append(errors, fmt.Errorf("The only acceptable Engine type when using Replication Groups is Redis"))
}
return
}

View File

@ -284,7 +284,6 @@ resource "aws_elasticache_security_group" "bar" {
resource "aws_elasticache_replication_group" "bar" {
replication_group_id = "tf-%s"
replication_group_description = "test description"
engine = "redis"
node_type = "cache.m1.small"
number_cache_clusters = 2
port = 6379
@ -319,7 +318,6 @@ resource "aws_elasticache_security_group" "bar" {
resource "aws_elasticache_replication_group" "bar" {
replication_group_id = "tf-%s"
replication_group_description = "updated description"
engine = "redis"
node_type = "cache.m1.small"
number_cache_clusters = 2
port = 6379
@ -354,7 +352,6 @@ resource "aws_elasticache_security_group" "bar" {
resource "aws_elasticache_replication_group" "bar" {
replication_group_id = "tf-%s"
replication_group_description = "updated description"
engine = "redis"
node_type = "cache.m1.medium"
number_cache_clusters = 2
port = 6379
@ -404,7 +401,6 @@ resource "aws_elasticache_replication_group" "bar" {
replication_group_description = "test description"
node_type = "cache.m1.small"
number_cache_clusters = 1
engine = "redis"
port = 6379
subnet_group_name = "${aws_elasticache_subnet_group.bar.name}"
security_group_ids = ["${aws_security_group.bar.id}"]
@ -466,7 +462,6 @@ resource "aws_elasticache_replication_group" "bar" {
replication_group_description = "test description"
node_type = "cache.m1.small"
number_cache_clusters = 2
engine = "redis"
port = 6379
subnet_group_name = "${aws_elasticache_subnet_group.bar.name}"
security_group_ids = ["${aws_security_group.bar.id}"]

View File

@ -20,7 +20,6 @@ resource "aws_elasticache_replication_group" "bar" {
replication_group_description = "test description"
node_type = "cache.m1.small"
number_cache_clusters = 2
engine = "redis"
port = 6379
parameter_group_name = "default.redis2.8"
availability_zones = ["us-west-2a", "us-west-2b"]
@ -34,17 +33,16 @@ The following arguments are supported:
* `replication_group_id` (Required) The replication group identifier. This parameter is stored as a lowercase string.
* `replication_group_description` (Required) A user-created description for the replication group.
* `number_cache_clusters` - (Required) The number of cache clusters this replication group will initially have.
* `number_cache_clusters` - (Required) The number of cache clusters this replication group will have.
If Multi-AZ is enabled , the value of this parameter must be at least 2. Changing this number will force a new resource
* `node_type` - (Required) The compute and memory capacity of the nodes in the node group.
* `engine` - (Required) The name of the cache engine to be used for the cache clusters in this replication group. The only valid value is Redis.
* `automatic_failover_enabled` - (Optional) Specifies whether a read-only replica will be automatically promoted to read/write primary if the existing primary fails. Defaults to `false`.
* `availability_zones` - (Optional) A list of EC2 availability zones in which the replication group's cache clusters will be created. The order of the availability zones in the list is not important.
* `engine_version` - (Optional) The version number of the cache engine to be used for the cache clusters in this replication group.
* `parameter_group_name` - (Optional) The name of the parameter group to associate with this replication group. If this argument is omitted, the default cache parameter group for the specified engine is used.
* `subnet_group_name` - (Optional) The name of the cache subnet group to be used for the replication group.
* `security_group_names` - (Optional) A list of cache security group names to associate with this replication group.
* `security_group_ids` - (Optional) One or more Amazon VPC security groups associated with this replication group.
* `security_group_ids` - (Optional) One or more Amazon VPC security groups associated with this replication group. Use this parameter only when you are creating a replication group in an Amazon Virtual Private Cloud
* `snapshot_arns`  (Optional) A single-element string list containing an
Amazon Resource Name (ARN) of a Redis RDB snapshot file stored in Amazon S3.
Example: `arn:aws:s3:::my_bucket/snapshot1.rdb`