Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

d/aws_db_instance: Add max_allocated_storage attribute #32477

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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