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

resource/aws_db_instance: Add max_allocated_storage argument (support Storage Autoscaling) #9087

Merged
merged 5 commits into from
Jun 27, 2019

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Jun 22, 2019

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

Closes #9076

Release note for CHANGELOG:

* resource/aws_db_instance: Add max_allocated_storage argument (support Storage Autoscaling)

Output from acceptance testing (test failures present in master):

--- FAIL: TestAccAWSDBInstance_optionGroup (9.60s)
--- PASS: TestAccAWSDBInstance_IsAlreadyBeingDeleted (407.82s)
--- PASS: TestAccAWSDBInstance_kmsKey (447.28s)
--- PASS: TestAccAWSDBInstance_iamAuth (468.51s)
--- PASS: TestAccAWSDBInstance_basic (469.82s)
--- PASS: TestAccAWSDBInstance_generatedName (509.47s)
--- PASS: TestAccAWSDBInstance_namePrefix (509.57s)
--- PASS: TestAccAWSDBInstance_DeletionProtection (534.93s)
--- PASS: TestAccAWSDBInstance_MaxAllocatedStorage (554.00s)
--- PASS: TestAccAWSDBInstance_FinalSnapshotIdentifier_SkipFinalSnapshot (640.05s)
--- FAIL: TestAccAWSDBInstance_ReplicateSourceDb_AutoMinorVersionUpgrade (839.74s)
--- PASS: TestAccAWSDBInstance_subnetGroup (864.75s)
--- PASS: TestAccAWSDBInstance_FinalSnapshotIdentifier (975.11s)
--- FAIL: TestAccAWSDBInstance_S3Import (661.46s)
--- PASS: TestAccAWSDBInstance_ReplicateSourceDb_BackupWindow (1464.99s)
--- PASS: TestAccAWSDBInstance_ReplicateSourceDb_MaxAllocatedStorage (1520.22s)
--- PASS: TestAccAWSDBInstance_ReplicateSourceDb_AvailabilityZone (1536.83s)
--- PASS: TestAccAWSDBInstance_ReplicateSourceDb_IamDatabaseAuthenticationEnabled (1586.30s)
--- PASS: TestAccAWSDBInstance_ReplicateSourceDb_MaintenanceWindow (1635.73s)
--- PASS: TestAccAWSDBInstance_ReplicateSourceDb (1697.74s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier (1263.54s)
--- PASS: TestAccAWSDBInstance_ReplicateSourceDb_VpcSecurityGroupIds (1349.56s)
--- PASS: TestAccAWSDBInstance_ReplicateSourceDb_BackupRetentionPeriod (1940.63s)
--- PASS: TestAccAWSDBInstance_ReplicateSourceDb_AllocatedStorage (1949.99s)
--- PASS: TestAccAWSDBInstance_ReplicateSourceDb_Port (1519.48s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier_AllocatedStorage (1475.69s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier_Io1Storage (1389.89s)
--- PASS: TestAccAWSDBInstance_ReplicateSourceDb_Monitoring (1623.10s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier_AutoMinorVersionUpgrade (1233.00s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier_AvailabilityZone (1245.29s)
--- PASS: TestAccAWSDBInstance_ReplicateSourceDb_ParameterGroupName (1661.06s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier_BackupRetentionPeriod (1285.34s)
--- PASS: TestAccAWSDBInstance_ReplicateSourceDb_MultiAZ (2146.49s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier_IamDatabaseAuthenticationEnabled (1083.14s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier_DeletionProtection (1149.70s)
--- PASS: TestAccAWSDBInstance_portUpdate (570.32s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier_BackupWindow (1234.86s)
--- PASS: TestAccAWSDBInstance_enhancedMonitoring (670.62s)
--- PASS: TestAccAWSDBInstance_separate_iops_update (632.53s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier_MaintenanceWindow (1335.83s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier_Monitoring (1225.51s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier_MaxAllocatedStorage (1295.29s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier_BackupRetentionPeriod_Unset (1799.33s)
--- PASS: TestAccAWSDBInstance_MinorVersion (343.49s)
--- PASS: TestAccAWSDBInstance_ec2Classic (395.42s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier_Port (1173.81s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier_VpcSecurityGroupIds_Tags (1094.16s)
--- PASS: TestAccAWSDBInstance_diffSuppressInitialState (443.64s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier_Tags (1223.46s)
--- PASS: TestAccAWSDBInstance_cloudwatchLogsExportConfiguration (511.70s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier_ParameterGroupName (1284.52s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier_VpcSecurityGroupIds (1196.15s)
--- PASS: TestAccAWSDBInstance_EnabledCloudwatchLogsExports_Postgresql (495.06s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier_MultiAZ (1638.76s)
--- PASS: TestAccAWSDBInstance_cloudwatchLogsExportConfigurationUpdate (759.27s)
--- PASS: TestAccAWSDBInstance_EnabledCloudwatchLogsExports_Oracle (686.93s)
--- PASS: TestAccAWSDBInstance_MSSQL_TZ (1926.59s)
--- PASS: TestAccAWSDBInstance_MySQL_SnapshotRestoreWithEngineVersion (1864.61s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier_PerformanceInsightsEnabled (1527.89s)
--- PASS: TestAccAWSDBInstance_ReplicateSourceDb_PerformanceInsightsEnabled (1632.72s)
--- PASS: TestAccAWSDBInstance_MSSQL_Domain (3296.64s)
--- PASS: TestAccAWSDBInstance_MSSQL_DomainSnapshotRestore (3228.09s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier_MultiAZ_SQLServer (4095.19s)

… Storage Autoscaling)

Reference: #9076

Output from acceptance testing (test failures present in master):

```
--- FAIL: TestAccAWSDBInstance_optionGroup (9.60s)
--- PASS: TestAccAWSDBInstance_IsAlreadyBeingDeleted (407.82s)
--- PASS: TestAccAWSDBInstance_kmsKey (447.28s)
--- PASS: TestAccAWSDBInstance_iamAuth (468.51s)
--- PASS: TestAccAWSDBInstance_basic (469.82s)
--- PASS: TestAccAWSDBInstance_generatedName (509.47s)
--- PASS: TestAccAWSDBInstance_namePrefix (509.57s)
--- PASS: TestAccAWSDBInstance_DeletionProtection (534.93s)
--- PASS: TestAccAWSDBInstance_MaxAllocatedStorage (554.00s)
--- PASS: TestAccAWSDBInstance_FinalSnapshotIdentifier_SkipFinalSnapshot (640.05s)
--- FAIL: TestAccAWSDBInstance_ReplicateSourceDb_AutoMinorVersionUpgrade (839.74s)
--- PASS: TestAccAWSDBInstance_subnetGroup (864.75s)
--- PASS: TestAccAWSDBInstance_FinalSnapshotIdentifier (975.11s)
--- FAIL: TestAccAWSDBInstance_S3Import (661.46s)
--- PASS: TestAccAWSDBInstance_ReplicateSourceDb_BackupWindow (1464.99s)
--- PASS: TestAccAWSDBInstance_ReplicateSourceDb_MaxAllocatedStorage (1520.22s)
--- PASS: TestAccAWSDBInstance_ReplicateSourceDb_AvailabilityZone (1536.83s)
--- PASS: TestAccAWSDBInstance_ReplicateSourceDb_IamDatabaseAuthenticationEnabled (1586.30s)
--- PASS: TestAccAWSDBInstance_ReplicateSourceDb_MaintenanceWindow (1635.73s)
--- PASS: TestAccAWSDBInstance_ReplicateSourceDb (1697.74s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier (1263.54s)
--- PASS: TestAccAWSDBInstance_ReplicateSourceDb_VpcSecurityGroupIds (1349.56s)
--- PASS: TestAccAWSDBInstance_ReplicateSourceDb_BackupRetentionPeriod (1940.63s)
--- PASS: TestAccAWSDBInstance_ReplicateSourceDb_AllocatedStorage (1949.99s)
--- PASS: TestAccAWSDBInstance_ReplicateSourceDb_Port (1519.48s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier_AllocatedStorage (1475.69s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier_Io1Storage (1389.89s)
--- PASS: TestAccAWSDBInstance_ReplicateSourceDb_Monitoring (1623.10s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier_AutoMinorVersionUpgrade (1233.00s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier_AvailabilityZone (1245.29s)
--- PASS: TestAccAWSDBInstance_ReplicateSourceDb_ParameterGroupName (1661.06s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier_BackupRetentionPeriod (1285.34s)
--- PASS: TestAccAWSDBInstance_ReplicateSourceDb_MultiAZ (2146.49s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier_IamDatabaseAuthenticationEnabled (1083.14s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier_DeletionProtection (1149.70s)
--- PASS: TestAccAWSDBInstance_portUpdate (570.32s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier_BackupWindow (1234.86s)
--- PASS: TestAccAWSDBInstance_enhancedMonitoring (670.62s)
--- PASS: TestAccAWSDBInstance_separate_iops_update (632.53s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier_MaintenanceWindow (1335.83s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier_Monitoring (1225.51s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier_MaxAllocatedStorage (1295.29s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier_BackupRetentionPeriod_Unset (1799.33s)
--- PASS: TestAccAWSDBInstance_MinorVersion (343.49s)
--- PASS: TestAccAWSDBInstance_ec2Classic (395.42s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier_Port (1173.81s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier_VpcSecurityGroupIds_Tags (1094.16s)
--- PASS: TestAccAWSDBInstance_diffSuppressInitialState (443.64s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier_Tags (1223.46s)
--- PASS: TestAccAWSDBInstance_cloudwatchLogsExportConfiguration (511.70s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier_ParameterGroupName (1284.52s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier_VpcSecurityGroupIds (1196.15s)
--- PASS: TestAccAWSDBInstance_EnabledCloudwatchLogsExports_Postgresql (495.06s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier_MultiAZ (1638.76s)
--- PASS: TestAccAWSDBInstance_cloudwatchLogsExportConfigurationUpdate (759.27s)
--- PASS: TestAccAWSDBInstance_EnabledCloudwatchLogsExports_Oracle (686.93s)
--- PASS: TestAccAWSDBInstance_MSSQL_TZ (1926.59s)
--- PASS: TestAccAWSDBInstance_MySQL_SnapshotRestoreWithEngineVersion (1864.61s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier_PerformanceInsightsEnabled (1527.89s)
--- PASS: TestAccAWSDBInstance_ReplicateSourceDb_PerformanceInsightsEnabled (1632.72s)
--- PASS: TestAccAWSDBInstance_MSSQL_Domain (3296.64s)
--- PASS: TestAccAWSDBInstance_MSSQL_DomainSnapshotRestore (3228.09s)
--- PASS: TestAccAWSDBInstance_SnapshotIdentifier_MultiAZ_SQLServer (4095.19s)
```
@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. service/rds Issues and PRs that pertain to the rds service. labels Jun 22, 2019
@bflad bflad requested review from a team June 22, 2019 00:08
@ghost ghost added size/L Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. documentation Introduces or discusses updates to documentation. labels Jun 22, 2019
Copy link
Contributor

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside from one comment/question LGTM👍

d.SetPartial("max_allocated_storage")
mas := d.Get("max_allocated_storage").(int)

if mas == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The correct way to disable mas is to set it to the current allocation? Wouldn’t that just set it to the current amount rather then disable ir🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah let me drop a comment in there! This is designed to cover both these scenarios for disabling autoscaling:

  • Setting the max_allocated_storage value equal to the allocated_storage value (the method documented in the AWS user guide)
  • Removing the max_allocated_storage configuration altogether (the 0 check)

I think from an operator perspective the second scenario could be expected behavior and the API will return an error if you try to set it to 0 as its expecting the allocated storage value to disable autoscaling. 👍

@bflad bflad added this to the v2.17.0 milestone Jun 27, 2019
@bflad bflad merged commit f0ec2a7 into master Jun 27, 2019
@bflad bflad deleted the f-aws_db_instance-storage-autoscaling branch June 27, 2019 18:51
bflad added a commit that referenced this pull request Jun 27, 2019
@bflad
Copy link
Contributor Author

bflad commented Jun 28, 2019

This has been released in version 2.17.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Nov 3, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Nov 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. service/rds Issues and PRs that pertain to the rds service. size/L Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for RDS Storage auto scaling
2 participants