Merge pull request #1966 from hashicorp/f-aws-db-instance-license-model
provider/aws: add license_model to db_instance
This commit is contained in:
commit
f0b85d465e
|
@ -102,6 +102,12 @@ func resourceAwsDbInstance() *schema.Resource {
|
||||||
Optional: true,
|
Optional: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"license_model": &schema.Schema{
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Optional: true,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
|
||||||
"maintenance_window": &schema.Schema{
|
"maintenance_window": &schema.Schema{
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
|
@ -228,6 +234,10 @@ func resourceAwsDbInstanceCreate(d *schema.ResourceData, meta interface{}) error
|
||||||
opts.AvailabilityZone = aws.String(attr.(string))
|
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 {
|
if attr, ok := d.GetOk("maintenance_window"); ok {
|
||||||
opts.PreferredMaintenanceWindow = aws.String(attr.(string))
|
opts.PreferredMaintenanceWindow = aws.String(attr.(string))
|
||||||
}
|
}
|
||||||
|
@ -316,6 +326,7 @@ func resourceAwsDbInstanceRead(d *schema.ResourceData, meta interface{}) error {
|
||||||
d.Set("availability_zone", v.AvailabilityZone)
|
d.Set("availability_zone", v.AvailabilityZone)
|
||||||
d.Set("backup_retention_period", v.BackupRetentionPeriod)
|
d.Set("backup_retention_period", v.BackupRetentionPeriod)
|
||||||
d.Set("backup_window", v.PreferredBackupWindow)
|
d.Set("backup_window", v.PreferredBackupWindow)
|
||||||
|
d.Set("license_model", v.LicenseModel)
|
||||||
d.Set("maintenance_window", v.PreferredMaintenanceWindow)
|
d.Set("maintenance_window", v.PreferredMaintenanceWindow)
|
||||||
d.Set("multi_az", v.MultiAZ)
|
d.Set("multi_az", v.MultiAZ)
|
||||||
if v.DBSubnetGroup != nil {
|
if v.DBSubnetGroup != nil {
|
||||||
|
|
|
@ -32,6 +32,8 @@ func TestAccAWSDBInstance(t *testing.T) {
|
||||||
"aws_db_instance.bar", "engine", "mysql"),
|
"aws_db_instance.bar", "engine", "mysql"),
|
||||||
resource.TestCheckResourceAttr(
|
resource.TestCheckResourceAttr(
|
||||||
"aws_db_instance.bar", "engine_version", "5.6.21"),
|
"aws_db_instance.bar", "engine_version", "5.6.21"),
|
||||||
|
resource.TestCheckResourceAttr(
|
||||||
|
"aws_db_instance.bar", "license_model", "general-public-license"),
|
||||||
resource.TestCheckResourceAttr(
|
resource.TestCheckResourceAttr(
|
||||||
"aws_db_instance.bar", "instance_class", "db.t1.micro"),
|
"aws_db_instance.bar", "instance_class", "db.t1.micro"),
|
||||||
resource.TestCheckResourceAttr(
|
resource.TestCheckResourceAttr(
|
||||||
|
|
Loading…
Reference in New Issue