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_autoscaling_policy: Properly read step_adjustment into Terraform state #7336

Merged

Commits on Jan 18, 2019

  1. Configuration menu
    Copy the full SHA
    46f4549 View commit details
    Browse the repository at this point in the history

Commits on Jan 25, 2019

  1. Merge branch 'feature/add-support-autoscaling-policy-import' of https…

    …://github.com/kterada0509/terraform-provider-aws into kterada0509-feature/add-support-autoscaling-policy-import
    bflad committed Jan 25, 2019
    Configuration menu
    Copy the full SHA
    ac093a5 View commit details
    Browse the repository at this point in the history
  2. resource/aws_autoscaling_policy: Properly read step_adjustment into T…

    …erraform state
    
    Previously, the resource was silently failing to read this attribute and therefore unable to perform drift detection or properly import the resource (currently being added).
    
    ```
    --- FAIL: TestAccAWSAutoscalingPolicy_basic (85.72s)
        testing.go:538: Step 2 error: ImportStateVerify attributes not equivalent. Difference is shown below. Top is actual, bottom is expected.
    
            (map[string]string) {
            }
    
            (map[string]string) (len=4) {
             (string) (len=17) "step_adjustment.#": (string) (len=1) "1",
             (string) (len=54) "step_adjustment.2042107634.metric_interval_lower_bound": (string) (len=1) "2",
             (string) (len=54) "step_adjustment.2042107634.metric_interval_upper_bound": (string) "",
             (string) (len=45) "step_adjustment.2042107634.scaling_adjustment": (string) (len=1) "1"
            }
    ```
    
    Returning the error from `d.Set()`:
    
    ```
    --- FAIL: TestAccAWSAutoscalingPolicy_basic (14.03s)
        testing.go:538: Step 0 error: Error applying: 1 error occurred:
            	* aws_autoscaling_policy.foobar_step: 1 error occurred:
            	* aws_autoscaling_policy.foobar_step: error setting step_adjustment: step_adjustment.0.metric_interval_lower_bound: '' expected type 'string', got unconvertible type 'float64'
    ```
    
    Output from acceptance testing after adjustments:
    
    ```
    --- PASS: TestAccAWSAutoscalingPolicy_zerovalue (44.61s)
    --- PASS: TestAccAWSAutoscalingPolicy_SimpleScalingStepAdjustment (46.60s)
    --- PASS: TestAccAWSAutoscalingPolicy_TargetTrack_Predefined (48.75s)
    --- PASS: TestAccAWSAutoscalingPolicy_disappears (72.73s)
    --- PASS: TestAccAWSAutoscalingPolicy_TargetTrack_Custom (74.47s)
    --- PASS: TestAccAWSAutoscalingPolicy_upgrade (76.43s)
    --- PASS: TestAccAWSAutoscalingPolicy_basic (82.25s)
    ```
    bflad committed Jan 25, 2019
    Configuration menu
    Copy the full SHA
    75bb031 View commit details
    Browse the repository at this point in the history