diff --git a/CHANGELOG.md b/CHANGELOG.md index 6126eeb3b..a077f74b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,10 +9,14 @@ BUG FIXES: * core: Return correct number of planned updates [GH-2620] * providers/aws: Allow uppercase characters in `aws_elb.name` [GH-2580] * providers/aws: Allow underscores in `aws_db_subnet_group.name` (undocumented by AWS) [GH-2604] + * provider/aws: Fix issue with pending Spot Instance requests [GH-2640] + * provider/aws: Fix issue in AWS Classic environment with referencing external + Security Groups [GH-2644] IMPROVEMENTS: * provider/aws: Create RDS databases from snapshots [GH-2062] + * provider/aws: Add support for restoring from Redis backup stored in S3 [GH-2634] ## 0.6.0 (June 30, 2015) diff --git a/builtin/providers/aws/resource_aws_elasticache_cluster.go b/builtin/providers/aws/resource_aws_elasticache_cluster.go index fe2139e36..fa0d6b746 100644 --- a/builtin/providers/aws/resource_aws_elasticache_cluster.go +++ b/builtin/providers/aws/resource_aws_elasticache_cluster.go @@ -110,6 +110,22 @@ func resourceAwsElasticacheCluster() *schema.Resource { }, }, + // A single-element string list containing an Amazon Resource Name (ARN) that + // uniquely identifies a Redis RDB snapshot file stored in Amazon S3. The snapshot + // file will be used to populate the node group. + // + // See also: + // https://github.com/aws/aws-sdk-go/blob/4862a174f7fc92fb523fc39e68f00b87d91d2c3d/service/elasticache/api.go#L2079 + "snapshot_arns": &schema.Schema{ + Type: schema.TypeSet, + Optional: true, + ForceNew: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: func(v interface{}) int { + return hashcode.String(v.(string)) + }, + }, + "tags": tagsSchema(), // apply_immediately is used to determine when the update modifications @@ -163,6 +179,13 @@ func resourceAwsElasticacheClusterCreate(d *schema.ResourceData, meta interface{ req.PreferredMaintenanceWindow = aws.String(v.(string)) } + snaps := d.Get("snapshot_arns").(*schema.Set).List() + if len(snaps) > 0 { + s := expandStringList(snaps) + req.SnapshotARNs = s + log.Printf("[DEBUG] Restoring Redis cluster from S3 snapshot: %#v", s) + } + _, err := conn.CreateCacheCluster(req) if err != nil { return fmt.Errorf("Error creating Elasticache: %s", err) diff --git a/builtin/providers/aws/resource_aws_spot_instance_request.go b/builtin/providers/aws/resource_aws_spot_instance_request.go index d37ef8a34..464a3de0c 100644 --- a/builtin/providers/aws/resource_aws_spot_instance_request.go +++ b/builtin/providers/aws/resource_aws_spot_instance_request.go @@ -166,7 +166,10 @@ func resourceAwsSpotInstanceRequestRead(d *schema.ResourceData, meta interface{} } d.Set("spot_bid_status", *request.Status.Code) - d.Set("spot_instance_id", *request.InstanceID) + // Instance ID is not set if the request is still pending + if request.InstanceID != nil { + d.Set("spot_instance_id", *request.InstanceID) + } d.Set("spot_request_state", *request.State) d.Set("tags", tagsToMap(request.Tags)) diff --git a/builtin/providers/aws/structure.go b/builtin/providers/aws/structure.go index d4847de1d..59bc61b14 100644 --- a/builtin/providers/aws/structure.go +++ b/builtin/providers/aws/structure.go @@ -157,12 +157,15 @@ func expandIPPerms( perm.UserIDGroupPairs[i] = &ec2.UserIDGroupPair{ GroupID: aws.String(id), - UserID: aws.String(ownerId), } + + if ownerId != "" { + perm.UserIDGroupPairs[i].UserID = aws.String(ownerId) + } + if !vpc { perm.UserIDGroupPairs[i].GroupID = nil perm.UserIDGroupPairs[i].GroupName = aws.String(id) - perm.UserIDGroupPairs[i].UserID = nil } } } diff --git a/website/source/docs/providers/aws/r/elasticache_cluster.html.markdown b/website/source/docs/providers/aws/r/elasticache_cluster.html.markdown index d6787a143..953b78a9c 100644 --- a/website/source/docs/providers/aws/r/elasticache_cluster.html.markdown +++ b/website/source/docs/providers/aws/r/elasticache_cluster.html.markdown @@ -69,6 +69,10 @@ names to associate with this cache cluster `false`. See [Amazon ElastiCache Documentation for more information.][1] (Available since v0.6.0) +* `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` + * `tags` - (Optional) A mapping of tags to assign to the resource.