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_redshift_cluster: Properly disable logging when using logging nested argument #5895

Merged
merged 1 commit into from
Sep 19, 2018

Commits on Sep 16, 2018

  1. resource/aws_redshift_cluster: Properly disable logging when using lo…

    …gging nested argument
    
    This is a quick fix until the deprecated `enabled_logging`, etc. arguments are removed in the next major version. Previously, when switching from logging being enabled to disabled, the update function would errantly reference both the deprecated `enable_logging` value from state (which would be true) and the new value `logging.0.enable` from configuration (which would be false) with a logical OR to determine whether logging should be enabled or disabled. We now treat the handling between the logging and deprecated arguments separately.
    
    The reason this was not previously handled was that the existing acceptance testing had a race condition that meant the EnableLogging call would not error if DeleteBucket had not been called yet, but otherwise could fail with:
    
    ```
    --- FAIL: TestAccAWSRedshiftCluster_loggingEnabled (1157.85s)
        testing.go:527: Step 1 error: Error applying: 1 error occurred:
            	* aws_redshift_cluster.default: 1 error occurred:
            	* aws_redshift_cluster.default: BucketNotFoundFault: Could not find bucket with name tf-redshift-logging-5762787809933873609
    ```
    
    Now the testing passes and verified that `DisableLogging` is correctly called in both tests:
    
    ```
    --- PASS: TestAccAWSRedshiftCluster_loggingEnabled (1377.47s)
    --- PASS: TestAccAWSRedshiftCluster_loggingEnabledDeprecated (1587.61s)
    ```
    bflad committed Sep 16, 2018
    Configuration menu
    Copy the full SHA
    0b518be View commit details
    Browse the repository at this point in the history