-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
resource/aws_autoscaling_policy: Properly read step_adjustment into Terraform state #7336
Conversation
…://github.com/kterada0509/terraform-provider-aws into kterada0509-feature/add-support-autoscaling-policy-import
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM after travis passes
Ha, we even had errant unit testing in this case:
I'll correct the unit testing. 😄 |
…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) ```
5fd80c1
to
75bb031
Compare
This has been released in version 1.57.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
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! |
This pull request builds on top of #7195 and only requires review of 5fd80c1
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).
Returning the error from
d.Set()
:Output from acceptance testing after adjustments: