Skip to content
This repository has been archived by the owner on Dec 19, 2017. It is now read-only.

Commit

Permalink
add StorageType as an RDS option
Browse files Browse the repository at this point in the history
  • Loading branch information
skippy committed Jan 23, 2015
1 parent b21af4d commit b1cc2d8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
11 changes: 11 additions & 0 deletions rds/rds.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ type DBInstance struct {
Port int `xml:"Endpoint>Port"`
PreferredBackupWindow string `xml:"PreferredBackupWindow"`
PreferredMaintenanceWindow string `xml:"PreferredMaintenanceWindow"`
StorageType string `xml:"StorageType"`
VpcSecurityGroupIds []string `xml:"VpcSecurityGroups>VpcSecurityGroupMembership>VpcSecurityGroupId"`
DBSecurityGroupNames []string `xml:"DBSecurityGroups>DBSecurityGroup>DBSecurityGroupName"`
DBSubnetGroup DBSubnetGroup `xml:"DBSubnetGroup"`
Expand Down Expand Up @@ -186,6 +187,7 @@ type CreateDBInstance struct {
PreferredBackupWindow string // hh24:mi-hh24:mi
PreferredMaintenanceWindow string // ddd:hh24:mi-ddd:hh24:mi
PubliclyAccessible bool
StorageType string
VpcSecurityGroupIds []string
DBSecurityGroupNames []string
DBParameterGroupName string
Expand Down Expand Up @@ -267,6 +269,10 @@ func (rds *Rds) CreateDBInstance(options *CreateDBInstance) (resp *SimpleResp, e
params["PubliclyAccessible"] = "true"
}

if options.StorageType != "" {
params["StorageType"] = options.StorageType
}

for j, group := range options.VpcSecurityGroupIds {
params["VpcSecurityGroupIds.member."+strconv.Itoa(j+1)] = group
}
Expand Down Expand Up @@ -691,6 +697,7 @@ type RestoreDBInstanceFromDBSnapshot struct {
OptionGroupName string
Port int
PubliclyAccessible bool
StorageType string

SetIops bool
SetPort bool
Expand Down Expand Up @@ -750,6 +757,10 @@ func (rds *Rds) RestoreDBInstanceFromDBSnapshot(options *RestoreDBInstanceFromDB
params["PubliclyAccessible"] = "true"
}

if options.StorageType != "" {
params["StorageType"] = options.StorageType
}

resp = &SimpleResp{}

err = rds.query(params, resp)
Expand Down
5 changes: 3 additions & 2 deletions rds/rds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func (s *S) Test_CreateDBInstance(c *C) {
MasterUserPassword: "bazbarbaz",
DBInstanceClass: "db.m1.small",
DBSecurityGroupNames: []string{"foo", "bar"},
StorageType: "gp2",
DBParameterGroupName: "default.mysql5.6",

SetBackupRetentionPeriod: true,
Expand Down Expand Up @@ -206,7 +207,7 @@ func (s *S) Test_DescribeDBParameters(c *C) {

options := rds.DescribeDBParameters{
DBParameterGroupName: "mydbparamgroup3",
Source: "user",
Source: "user",
}

resp, err := s.rds.DescribeDBParameters(&options)
Expand Down Expand Up @@ -379,7 +380,7 @@ func (s *S) Test_ModifyDBParameterGroup(c *C) {

options := rds.ModifyDBParameterGroup{
DBParameterGroupName: "mydbparamgroup3",
Parameters: []rds.Parameter{
Parameters: []rds.Parameter{
rds.Parameter{
ApplyMethod: "immediate",
ParameterName: "character_set_server",
Expand Down

0 comments on commit b1cc2d8

Please sign in to comment.