merge master

This commit is contained in:
Clint Shryock 2015-07-08 13:05:33 -06:00
commit ef28007988
5 changed files with 40 additions and 3 deletions

View File

@ -9,10 +9,14 @@ BUG FIXES:
* core: Return correct number of planned updates [GH-2620] * core: Return correct number of planned updates [GH-2620]
* providers/aws: Allow uppercase characters in `aws_elb.name` [GH-2580] * 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] * 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: IMPROVEMENTS:
* provider/aws: Create RDS databases from snapshots [GH-2062] * 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) ## 0.6.0 (June 30, 2015)

View File

@ -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(), "tags": tagsSchema(),
// apply_immediately is used to determine when the update modifications // 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)) 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) _, err := conn.CreateCacheCluster(req)
if err != nil { if err != nil {
return fmt.Errorf("Error creating Elasticache: %s", err) return fmt.Errorf("Error creating Elasticache: %s", err)

View File

@ -166,7 +166,10 @@ func resourceAwsSpotInstanceRequestRead(d *schema.ResourceData, meta interface{}
} }
d.Set("spot_bid_status", *request.Status.Code) 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("spot_request_state", *request.State)
d.Set("tags", tagsToMap(request.Tags)) d.Set("tags", tagsToMap(request.Tags))

View File

@ -157,12 +157,15 @@ func expandIPPerms(
perm.UserIDGroupPairs[i] = &ec2.UserIDGroupPair{ perm.UserIDGroupPairs[i] = &ec2.UserIDGroupPair{
GroupID: aws.String(id), GroupID: aws.String(id),
UserID: aws.String(ownerId),
} }
if ownerId != "" {
perm.UserIDGroupPairs[i].UserID = aws.String(ownerId)
}
if !vpc { if !vpc {
perm.UserIDGroupPairs[i].GroupID = nil perm.UserIDGroupPairs[i].GroupID = nil
perm.UserIDGroupPairs[i].GroupName = aws.String(id) perm.UserIDGroupPairs[i].GroupName = aws.String(id)
perm.UserIDGroupPairs[i].UserID = nil
} }
} }
} }

View File

@ -69,6 +69,10 @@ names to associate with this cache cluster
`false`. See [Amazon ElastiCache Documentation for more information.][1] `false`. See [Amazon ElastiCache Documentation for more information.][1]
(Available since v0.6.0) (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. * `tags` - (Optional) A mapping of tags to assign to the resource.