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: Prevent error when using snapshot_identifier with multi_az enabled and sqlserver engine #5613

Merged
merged 1 commit into from
Aug 20, 2018

Commits on Aug 20, 2018

  1. resource/aws_db_instance: Prevent error when using snapshot_identifie…

    …r with multi_az enabled and sqlserver engine
    
    When calling `RestoreDBInstanceFromDBSnapshot` and attempting to enable `MultiAZ` with `Engine` set to SQL server, it first must be set to disabled since the API requires `BackupRetentionPeriod`, but that parameter is not available for the initial API call.
    
    * When using `multi_az` with `snapshot_identifier` and `engine` set to `sqlserver*`, remove parameter or catch specific error and require `ModifyDBInstance` API call afterwards
    * When `ModifyDBInstance` is being called during resource creation, always set `ApplyImmediately` to `true` to prevent need for double apply.
    
    Previously:
    
    ```
    --- FAIL: TestAccAWSDBInstance_SnapshotIdentifier_MultiAZ_SQLServer (1101.33s)
    	testing.go:527: Step 0 error: Error applying: 1 error occurred:
    			* aws_db_instance.test: 1 error occurred:
    			* aws_db_instance.test: Error creating DB Instance: InvalidParameterValue: Mirroring cannot be applied to instances with backup retention set to zero.
    ```
    
    Now:
    
    ```
    --- PASS: TestAccAWSDBInstance_SnapshotIdentifier_MultiAZ_SQLServer (4031.24s)
    ```
    bflad committed Aug 20, 2018
    Configuration menu
    Copy the full SHA
    f60e13e View commit details
    Browse the repository at this point in the history