provider/aws: add license_model to db_instance
This commit is contained in:
parent
8a3b75d361
commit
7d9ee79660
|
@ -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,
|
||||
|
@ -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))
|
||||
}
|
||||
|
@ -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 {
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue