Commit Graph

5 Commits

Author SHA1 Message Date
Paul Stack 272f8ddee1 provider/aws: Refresh `aws_autoscaling_policy` from state on 404 (#8430)
* provider/aws: Refresh `aws_autoscaling_policy` from state on 404

Fixes #8386

When an Autoscaling Group Or an Autoscaling Group Policy has been
deleted manually, terraform was throwing an error as follows:

```
* aws_autoscaling_policy.increase: Error retrieving scaling policies: ValidationError: Group sandbox-logs-logstash-wxhsckky3ndpzd7b3kmyontngy not found
        status code: 400, request id: 56a89814-6884-11e6-b3a8-d364cf04223b
```

We now refresh from state on a ValidationError - this is a common 4xx error according to AWS documentation http://docs.aws.amazon.com/AutoScaling/latest/APIReference/CommonErrors.html

```
%make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSAutoscalingPolicy_disappears'
==> Checking that code complies with gofmt requirements...
/Users/stacko/Code/go/bin/stringer
go generate $(go list ./... | grep -v /terraform/vendor/)
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSAutoscalingPolicy_disappears -timeout 120m
=== RUN   TestAccAWSAutoscalingPolicy_disappears
--- PASS: TestAccAWSAutoscalingPolicy_disappears (203.61s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	203.633s
```

* Update resource_aws_autoscaling_policy.go
2016-08-24 11:06:01 +01:00
Clint 068f6f606d provider/aws: Fix issue in upgrading AutoScaling Policy (#6440)
* provider/aws: Fix issue in upgrading AutoScaling Policy min_adjustment_steps

- Update depreciation message on min_adjustment_step
2016-05-05 10:17:54 -05:00
Christopher Tiwald 305a450239 aws_autoscaling_policy: Add support for StepScaling policies.
Unlike SimpleScaling policies, StepScaling policies require one or more
"steps", which are interval ranges in which a tracked metric can lie.
Policies can then execute scaling adjustments wedded to these steps.

This commit also adds a slew of additional policy attributes which are
only applicable to step policies.
2016-03-24 16:35:54 -04:00
Clint Shryock 579ccbefea provider/aws: Update source to comply with upstream breaking change 2015-07-28 15:29:46 -05:00
Alex Pilon 05f4b9bfd9 provider/aws: Add autoscaling_policy 2015-06-17 23:10:23 +01:00