Skip to content

Commit

Permalink
Merge pull request #1966 from hashicorp/f-aws-db-instance-license-model
Browse files Browse the repository at this point in the history
provider/aws: add license_model to db_instance
  • Loading branch information
phinze committed May 14, 2015
2 parents 8a3b75d + 7d9ee79 commit f0b85d4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions builtin/providers/aws/resource_aws_db_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ func resourceAwsDbInstance() *schema.Resource {
Optional: true,
},

"license_model": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Computed: true,
},

"maintenance_window": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -228,6 +234,10 @@ func resourceAwsDbInstanceCreate(d *schema.ResourceData, meta interface{}) error
opts.AvailabilityZone = aws.String(attr.(string))
}

if attr, ok := d.GetOk("license_model"); ok {
opts.LicenseModel = aws.String(attr.(string))
}

if attr, ok := d.GetOk("maintenance_window"); ok {
opts.PreferredMaintenanceWindow = aws.String(attr.(string))
}
Expand Down Expand Up @@ -316,6 +326,7 @@ func resourceAwsDbInstanceRead(d *schema.ResourceData, meta interface{}) error {
d.Set("availability_zone", v.AvailabilityZone)
d.Set("backup_retention_period", v.BackupRetentionPeriod)
d.Set("backup_window", v.PreferredBackupWindow)
d.Set("license_model", v.LicenseModel)
d.Set("maintenance_window", v.PreferredMaintenanceWindow)
d.Set("multi_az", v.MultiAZ)
if v.DBSubnetGroup != nil {
Expand Down
2 changes: 2 additions & 0 deletions builtin/providers/aws/resource_aws_db_instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ func TestAccAWSDBInstance(t *testing.T) {
"aws_db_instance.bar", "engine", "mysql"),
resource.TestCheckResourceAttr(
"aws_db_instance.bar", "engine_version", "5.6.21"),
resource.TestCheckResourceAttr(
"aws_db_instance.bar", "license_model", "general-public-license"),
resource.TestCheckResourceAttr(
"aws_db_instance.bar", "instance_class", "db.t1.micro"),
resource.TestCheckResourceAttr(
Expand Down

0 comments on commit f0b85d4

Please sign in to comment.