terraform/builtin/providers
Paul Stack cf3d234f5c provider/aws: Refresh aws_autoscaling_schedule from state when autoscaling_group (#12312)
not found

Fixes: #12279

When manually deleting an autoscaling_group from the console, a
terraform plan would look as follows:

```
% terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.

aws_launch_configuration.foobar: Refreshing state... (ID: test-0096cf26c7eebdc9fcb5bd1837)
aws_autoscaling_group.foobar: Refreshing state... (ID: test)
aws_autoscaling_schedule.foobar: Refreshing state... (ID: foobar)
Error refreshing state: 1 error(s) occurred:

* aws_autoscaling_schedule.foobar: aws_autoscaling_schedule.foobar: Error retrieving Autoscaling Scheduled Actions: ValidationError: Group test not found
	status code: 400, request id: 093e9ed5-fe01-11e6-b990-1f64334b3a10

```

After this patch:

```
% terraform plan                                                                                                                          ✹ ✭
[WARN] /Users/stacko/Code/go/bin/terraform-provider-aws overrides an internal plugin for aws-provider.
  If you did not expect to see this message you will need to remove the old plugin.
  See https://www.terraform.io/docs/internals/internal-plugins.html
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.

aws_launch_configuration.foobar: Refreshing state... (ID: test-0096cf26c7eebdc9fcb5bd1837)
aws_autoscaling_group.foobar: Refreshing state... (ID: test)
aws_autoscaling_schedule.foobar: Refreshing state... (ID: foobar)
The Terraform execution plan has been generated and is shown below.
Resources are shown in alphabetical order for quick scanning. Green resources
will be created (or destroyed and then created if an existing resource
exists), yellow resources are being changed in-place, and red resources
will be destroyed. Cyan entries are data sources to be read.

Note: You didn't specify an "-out" parameter to save this plan, so when
"apply" is called, Terraform can't guarantee this is what will execute.

+ aws_autoscaling_group.foobar
    arn:                               "<computed>"
    availability_zones.#:              "1"
    availability_zones.2487133097:     "us-west-2a"
    default_cooldown:                  "<computed>"
    desired_capacity:                  "<computed>"
    force_delete:                      "true"
    health_check_grace_period:         "300"
    health_check_type:                 "ELB"
    launch_configuration:              "test-0096cf26c7eebdc9fcb5bd1837"
    load_balancers.#:                  "<computed>"
    max_size:                          "1"
    metrics_granularity:               "1Minute"
    min_size:                          "1"
    name:                              "test"
    protect_from_scale_in:             "false"
    tag.#:                             "1"
    tag.157008572.key:                 "Foo"
    tag.157008572.propagate_at_launch: "true"
    tag.157008572.value:               "foo-bar"
    termination_policies.#:            "1"
    termination_policies.0:            "OldestInstance"
    vpc_zone_identifier.#:             "<computed>"
    wait_for_capacity_timeout:         "10m"

+ aws_autoscaling_schedule.foobar
    arn:                    "<computed>"
    autoscaling_group_name: "test"
    desired_capacity:       "0"
    end_time:               "2017-12-12T06:00:00Z"
    max_size:               "1"
    min_size:               "0"
    recurrence:             "<computed>"
    scheduled_action_name:  "foobar"
    start_time:             "2017-12-11T18:00:00Z"

Plan: 2 to add, 0 to change, 0 to destroy.
```
2017-02-28 22:08:22 +00:00
..
alicloud
archive
arukas New provider arukas (#11171) 2017-02-13 19:11:30 +00:00
atlas
aws provider/aws: Refresh aws_autoscaling_schedule from state when autoscaling_group (#12312) 2017-02-28 22:08:22 +00:00
azure
azurerm provider/azurerm: Bump AzureRM SDK to v8.0.1-beta (#11866) 2017-02-23 18:14:55 +02:00
bitbucket
chef
clc
cloudflare add missing return 2017-02-16 07:57:34 -05:00
cloudstack
cobbler
consul Remove the AWS Access Key and Secret Access keys from the (#12061) 2017-02-17 13:36:38 -08:00
datadog provider/datadog: Add datadog_user resource (#12268) 2017-02-27 10:38:54 +00:00
digitalocean provider/digitalocean: Add support for LoadBalancers (#12077) 2017-02-23 23:41:20 +02:00
dme
dns provider/dns: DNS dynamic updates (RFC 2136) 2017-02-10 21:38:26 +01:00
dnsimple
docker
dyn
external
fastly provider/fastly Adds fastly response object (#12032) 2017-02-17 10:36:05 -06:00
github
google providers/google: google_project supports billing account (#11653) 2017-02-20 19:32:24 +02:00
grafana
heroku
icinga2
ignition
influxdb
librato
logentries
mailgun
mysql
newrelic
nomad
ns1
null
openstack provider/openstack: Rename provider to loadbalancer_provider (#12239) 2017-02-28 16:06:49 +00:00
opsgenie
packet
pagerduty Setting incident_urgency_rule as optional (#12211) 2017-02-23 21:35:45 +02:00
postgresql
powerdns
profitbricks provider/profitbricks: fmt changes post cherry-pick 2017-02-23 18:07:29 +02:00
rabbitmq
rancher rancher: parse Rancher client cli.json config file (#11658) 2017-02-15 09:51:56 +00:00
random Add a prefix option to random_id provider 2017-02-16 11:08:17 -05:00
rundeck
scaleway
softlayer
spotinst provider/spotinst: Disallow passing an empty user_data string (#12179) 2017-02-22 23:25:03 +02:00
statuscake provider/statuscake: Fixing up the StatusCake acceptance tests (#12006) 2017-02-16 16:20:23 +02:00
template
terraform providers/terraform: data source uses backends for state loading 2017-02-22 11:37:56 -08:00
test flatmap: mark computed list as a computed value in Expand 2017-02-23 10:03:59 -08:00
tls
triton
ultradns ultradns: revert record thresholds 2017-02-10 13:11:33 -08:00
vault provider/vault: vault_policy resource (#10980) 2017-02-13 18:53:45 +00:00
vcd
vsphere