Skip to content

Commit

Permalink
Merge pull request #32477 from an2nb2/f-aws_db_instance-add_max_alloc…
Browse files Browse the repository at this point in the history
…ated_storage_to_data

d/aws_db_instance: Add max_allocated_storage attribute
  • Loading branch information
johnsonaj authored Jul 14, 2023
2 parents 8679dcf + 5dbc1c5 commit d040180
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/32477.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
data-source/aws_db_instance: Add `max_allocated_storage` attribute
```
5 changes: 5 additions & 0 deletions internal/service/rds/instance_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ func DataSourceInstance() *schema.Resource {
},
},
},
"max_allocated_storage": {
Type: schema.TypeInt,
Computed: true,
},
"monitoring_interval": {
Type: schema.TypeInt,
Computed: true,
Expand Down Expand Up @@ -252,6 +256,7 @@ func dataSourceInstanceRead(ctx context.Context, d *schema.ResourceData, meta in
return sdkdiag.AppendErrorf(diags, "setting master_user_secret: %s", err)
}
}
d.Set("max_allocated_storage", v.MaxAllocatedStorage)
d.Set("monitoring_interval", v.MonitoringInterval)
d.Set("monitoring_role_arn", v.MonitoringRoleArn)
d.Set("multi_az", v.MultiAZ)
Expand Down
2 changes: 2 additions & 0 deletions internal/service/rds/instance_data_source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func TestAccRDSInstanceDataSource_basic(t *testing.T) {
resource.TestCheckResourceAttrPair(dataSourceName, "hosted_zone_id", resourceName, "hosted_zone_id"),
resource.TestCheckResourceAttrPair(dataSourceName, "iops", resourceName, "iops"),
resource.TestCheckResourceAttrPair(dataSourceName, "master_username", resourceName, "username"),
resource.TestCheckResourceAttrPair(dataSourceName, "max_allocated_storage", resourceName, "max_allocated_storage"),
resource.TestCheckResourceAttrPair(dataSourceName, "multi_az", resourceName, "multi_az"),
resource.TestCheckResourceAttrPair(dataSourceName, "network_type", resourceName, "network_type"),
resource.TestCheckResourceAttrPair(dataSourceName, "port", resourceName, "port"),
Expand Down Expand Up @@ -120,6 +121,7 @@ resource "aws_db_instance" "test" {
password = "avoid-plaintext-passwords"
skip_final_snapshot = true
username = "tfacctest"
max_allocated_storage = 100
enabled_cloudwatch_logs_exports = [
"audit",
Expand Down
1 change: 1 addition & 0 deletions website/docs/d/db_instance.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ In addition to all arguments above, the following attributes are exported:
* `license_model` - License model information for this DB instance.
* `master_username` - Contains the master username for the DB instance.
* `master_user_secret` - Provides the master user secret. Only available when `manage_master_user_password` is set to true. [Documented below](#master_user_secret).
* `max_allocated_storage` - The upper limit to which Amazon RDS can automatically scale the storage of the DB instance.
* `monitoring_interval` - Interval, in seconds, between points when Enhanced Monitoring metrics are collected for the DB instance.
* `monitoring_role_arn` - ARN for the IAM role that permits RDS to send Enhanced Monitoring metrics to CloudWatch Logs.
* `multi_az` - If the DB instance is a Multi-AZ deployment.
Expand Down

0 comments on commit d040180

Please sign in to comment.