Commit Graph

105 Commits

Author SHA1 Message Date
Joshua Spence f40997988e Add `name_prefix` to `aws_autoscaling_group` and `aws_elb` resources (#12629)
Adds support for `name_prefix` to the `aws_autoscaling_group` and `aws_elb` resources. Unfortunately when using `name_prefix` with `aws_elb`, this means that the specified prefix can only be a maximum of 6 characters in length. This is because the maximum length for an ELB name is 32 characters, and `resource.PrefixedUniqueId` generates a 26-character unique identifier. I was considering truncating the unique identifier to allow for a longer `name_prefix`, but I worried that doing so would increase the risk of collisions.
2017-03-20 13:06:45 +00:00
Paul Stack b3fad6a68c provider/aws: Addition of suspended_processes to aws_autoscaling_group (#10096)
Fixes #8954

Addition of the support of autoScaling group suspended_processes
2016-11-21 17:02:20 +02:00
Chris Marchesi 67d162a126 provider/aws: aws_autoscaling_group ALB target group support (#10243)
This update adds ALB support to the
wait_for_elb_capacity/min_elb_capacity options. Target groups are
handled in nearly the same way as Classic ELBs, so the change should be
transparent. This supports both ALB target groups and classic ELBs being
attached to the ASG at the same time.
2016-11-21 11:50:58 +02:00
Justin Nauman 9e11b59814 provider/aws: aws_autoscaling_attachment resource (#9146)
* GH-8755 - Adding in support to attach ASG to ELB as independent action

* GH-8755 - Adding in docs

* GH-8755 - Adjusting attribute name and responding to other PR feedback
2016-11-03 13:08:49 +00:00
Radek Simko 2ad84a51df
provider/aws: Fix misspelled words 2016-09-12 07:23:34 +01:00
stack72 7dd7078b82
Merge branch 'pcarrier/aws_autoscaling_group_can_have_initial_lifecycle_hooks' of https://github.com/pcarrier/terraform into pcarrier-pcarrier/aws_autoscaling_group_can_have_initial_lifecycle_hooks 2016-09-04 02:08:04 +03:00
Clint 740b8bb9cb provider/aws: Run errcheck in tests (#8579)
* provider/aws: Add errcheck to Makefile, error on unchecked errors

* more exceptions

* updates for errcheck to pass

* reformat and spilt out the ignore statements

* narrow down ignores

* fix typo, only ignore Close and Write, instead of close or write
2016-09-02 09:24:17 -05:00
Pierre Carrier 2410294a9d providers/aws: support for lifecycle hooks at ASG creation
Closes hashicorp/terraform#5619.
2016-09-01 10:21:37 -07:00
Clint daac877c82 provider/aws: Get and export ASG ARN value (#8503) 2016-08-27 15:20:11 +01:00
Clint 771155cea5 provider/aws: Add support for TargetGroups to AutoScaling Groups (#8327)
* start of ALB support. Waiting for ALB top level to move forward

* initial test

* cleanup

* small docs

* beef up test
2016-08-19 14:07:53 -05:00
Paul Stack ee9114bcc4 provider/aws: Fix bug with Updating `aws_autoscaling_group` (#7698)
`enabled_metrics`

Fixes #7693

The metrics_granularity parameter was not being passed to the
`EnableMetricsCollection` when we were calling it from the Update func.
this was causing the API call to silently fail and not update the
metrics for collection - unfortunately the enabled_metrics were still
being added to the state :(

By passing the granularity, we now get the correct metrics for
collection

```
% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSAutoScalingGroup_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
TF_ACC=1 go test ./builtin/providers/aws -v
-run=TestAccAWSAutoScalingGroup_ -timeout 120m
=== RUN   TestAccAWSAutoScalingGroup_importBasic
--- PASS: TestAccAWSAutoScalingGroup_importBasic (166.86s)
=== RUN   TestAccAWSAutoScalingGroup_basic
--- PASS: TestAccAWSAutoScalingGroup_basic (240.23s)
=== RUN   TestAccAWSAutoScalingGroup_autoGeneratedName
--- PASS: TestAccAWSAutoScalingGroup_autoGeneratedName (50.29s)
=== RUN   TestAccAWSAutoScalingGroup_terminationPolicies
--- PASS: TestAccAWSAutoScalingGroup_terminationPolicies (79.93s)
=== RUN   TestAccAWSAutoScalingGroup_tags
--- PASS: TestAccAWSAutoScalingGroup_tags (270.79s)
=== RUN   TestAccAWSAutoScalingGroup_VpcUpdates
--- PASS: TestAccAWSAutoScalingGroup_VpcUpdates (77.76s)
=== RUN   TestAccAWSAutoScalingGroup_WithLoadBalancer
--- PASS: TestAccAWSAutoScalingGroup_WithLoadBalancer (400.67s)
=== RUN   TestAccAWSAutoScalingGroup_withPlacementGroup
--- PASS: TestAccAWSAutoScalingGroup_withPlacementGroup (134.39s)
=== RUN   TestAccAWSAutoScalingGroup_enablingMetrics
--- PASS: TestAccAWSAutoScalingGroup_enablingMetrics (305.32s)
=== RUN   TestAccAWSAutoScalingGroup_withMetrics
--- PASS: TestAccAWSAutoScalingGroup_withMetrics (48.56s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws
1774.819s
```
2016-07-20 19:36:45 +01:00
Jason Wieringa 79dd1c7d80 Protect instance from autoscale in on aws_autoscaling_group (#6490)
* Add support for NewInstancesProtectedFromScaleIn on aws_autoscaling_group

* Add documentation for aws_autoscaling_group protect_from_scale_in
2016-06-29 07:36:34 +01:00
Mitchell Hashimoto 9cdbed11ff
providers/aws: ebs volume and autoscaling group 2016-05-16 10:03:57 -07:00
Mitchell Hashimoto f0511631bf
provider/aws: id-only refresh for autoscaling groups 2016-04-21 21:36:52 -07:00
Paul Hinze 6f76fb0702 provider/aws: set ASG health_check_grace_period default to 300
Closes #5658
2016-03-23 18:55:37 -05:00
Paul Hinze 108ccf0007 builtin: Refactor resource.Retry to clarify return
Change the `RetryFunc` from a plain `error` return type to a
specialized `RetryError` which must decide whether it is
retryable or not.

Add `RetryableError` / `NonRetryableError` factory functions that
callers are meant to use to build up these errors.

This makes it eminently clear whether or not a given error is
retryable from inside the client code.

Goal here is to _not_ change any behavior, simply reflect the
existing behavior with the new, clearer, API.
2016-03-09 17:37:56 -06:00
stack72 d3697fa50b provider/aws: Combine AWS Metrics Collection resource and AWS
Autoscaling Group
2016-02-29 20:58:41 +00:00
stack72 4fc1391303 Scaffold the AWS Autoscaling Group Metrics Collection 2016-02-29 19:24:30 +00:00
Paul Hinze b5e6a4fac7 Merge pull request #5101 from tpounds/fix-read-aws-asg-termination-policies
provider/aws: Fix reading auto scaling group termination policies
2016-02-23 08:03:18 -06:00
Trevor Pounds b39cc55f37 Cleanup termination policy update logic. 2016-02-22 17:05:09 -08:00
Trevor Pounds 44b00782c3 Fix termination policies read logic. 2016-02-22 17:05:09 -08:00
Paul Stack 0214319333 Merge pull request #4882 from stack72/f-aws-asg-getAutoscaleGroup
provider/aws: Autoscaling Group Code Refactor
2016-02-22 09:58:53 +00:00
Paul Stack 4baa8fa691 Merge pull request #5044 from tpounds/fix-read-aws-asg-az
provider/aws: Fix reading auto scaling group availability zones
2016-02-08 21:37:23 +00:00
Trevor Pounds 8ceeaaf7ff Fix load balancers read logic. 2016-02-07 15:00:21 -08:00
Trevor Pounds 37eb1cba88 Make availability zones a computed attribute.
Fixes a diff calculation error when only a VPC zone
identifiers is provided. In this case the associated
availability zones are computed from the subnets per
the AWS documentation.
2016-02-07 14:14:00 -08:00
Trevor Pounds e0f4be47a8 Remove redundant metadata get. 2016-02-07 14:14:00 -08:00
Trevor Pounds cd42705bf1 Fix availability zones read logic. 2016-02-07 14:14:00 -08:00
stack72 bd4f8ed800 Refactoring the getAwsAutoscalingGroup func to accept only the arguments it needs rather than ResourceData and meta. This makes it more portable and reusable 2016-01-28 17:52:35 +00:00
Paul Hinze c70eab6500 aws: undeprecate min_elb_capacity; restore min capacity waiting
It was a mistake to switched fully to `==` when activating waiting for
capacity on updates in #3947. Users that didn't set `min_elb_capacity ==
desired_capacity` and instead treated it as an actual "minimum" would
see timeouts for every create, since their target numbers would never be
reached exactly.

Here, we fix that regression by restoring the minimum waiting behavior
during creates.

In order to preserve all the stated behavior, I had to split out
different criteria for create and update, criteria which are now
exhaustively unit tested.

The set of fields that affect capacity waiting behavior has become a bit
of a mess. Next major release I'd like to rework all of these into a
more consistently named block of config. For now, just getting the
behavior correct and documented.

(Also removes all the fixed names from the ASG tests as I was hitting
collision issues running them over here.)

Fixes #4792
2016-01-27 13:30:44 -06:00
Paul Hinze 319f7d77a0 Merge pull request #3947 from hashicorp/phinze/asg-wait-on-update
provider/aws: wait for ASG capacity on update
2016-01-06 15:55:43 -06:00
Paul Hinze 709d1f3599 Merge pull request #3704 from dayer4b/add-placement-group
added placement group as an option for autoscaling groups
2015-12-03 18:05:01 -06:00
Paul Hinze 7f9360797c provider/aws: wait for ASG capacity on update
It's a bit confusing to have Terraform poll until instances come up on
ASG creation but not on update. This changes update to also poll if
min_size or desired_capacity are changed.

This changes the waiting behavior to wait for precisely the desired
number of instances instead of that number as a "minimum". I believe
this shouldn't have any undue side effects, and the behavior can still
be opted out of by setting `wait_for_capacity_timeout` to 0.
2015-11-17 10:25:41 -06:00
Sunil K Chopra c7b02d9fdb handling updates 2015-11-02 09:33:46 -06:00
Sunil K Chopra 68c7baa20e as per advice from stack72 to stick to strings 2015-11-02 09:33:35 -06:00
Sunil K Chopra 0d2007e8bd as per advice from stack72, simplified 2015-11-02 09:26:25 -06:00
stack72 69b905fb92 Making the AutoScalingGroup name optiona 2015-10-31 09:24:46 +00:00
Sunil K Chopra 006cac56a2 added placement group as an option for autoscaling groups 2015-10-30 16:45:19 -05:00
Clint 3ce656b007 Merge pull request #2890 from pforman/asg-termination
Update AWS ASG termination policy code and tests
2015-10-26 16:42:53 -05:00
Paul Hinze 5f6c03f515 Merge pull request #3191 from hashicorp/f-asg-wait-config
provider/aws: configurable capacity waiting duration
2015-10-14 10:34:55 -05:00
Paul Hinze a811a72f11 provider/aws: fix force_delete on ASGs
The `ForceDelete` parameter was getting sent to the upstream API call,
but only after we had already finished draining instances from
Terraform, so it was a moot point by then.

This fixes that by skipping the drain when force_delete is true, and it
also simplifies the field config a bit:

 * set a default of false to simplify the logic
 * remove `ForceNew` since there's no need to replace the resource to
   flip this value
 * pull a detail comment from code into the docs
2015-10-12 17:10:01 -05:00
Paul Hinze 506aae2f28 provider/aws: configurable capacity waiting duration
move wait for capacity timeout from a constant to a configurable
2015-09-08 13:22:42 -05:00
Clint Shryock 0c2f189d08 provider/aws: Update to aws-sdk 0.9.0 rc1 2015-08-17 13:27:16 -05:00
Paul Forman c617445fec Update AWS ASG termination policy code and tests
The initial commit of AWS autoscaling group termination policy was
unfinished.  It only worked on "create", and so had a needless ForceNew
that would rebuild autoscaling groups on any change.  It also used a
HashString set, so it didn't preserve ordering of multiple policies
correctly.

Added the "update" operation, and converted to a TypeList to preserve
ordering.  In addition, removing the policy or setting it to a null list
will reset the policy to "Default", the standard AWS policy.

Updated the acceptance tests to verify the update, but the null case is
difficult to test.
2015-07-29 22:56:56 -06:00
Clint Shryock 579ccbefea provider/aws: Update source to comply with upstream breaking change 2015-07-28 15:29:46 -05:00
Clint Shryock ed98e02e4a provider/aws: Improved Auto Scaling Groups updates
- availability zones are optional if you specify a VPC Zone Identifier (subnet)
- availability zones can be updated in place
2015-07-14 10:19:10 -05:00
Radek Simko 23459ec840 provider/aws: Add validation for aws_autoscaling_group.name 2015-06-26 15:43:06 +01:00
Nathan Sullivan 4a791c1b41 default_cooldown change shouldnt force new resource - https://github.com/hashicorp/terraform/issues/2509 - credit to
@phinze and @mzupan for https://github.com/hashicorp/terraform/pull/2147
2015-06-26 15:51:31 +10:00
Clint Shryock 6e818785af provider/aws: Update ASGs to support in-place updates for Load Balancers 2015-06-24 16:37:23 -05:00
Paul Hinze 611741c108 typo 2015-06-18 15:47:54 -05:00
Jack Pearkes 6c29671561 provider/aws: clarify scaling timeout error
This just gives the user a better hint to why their scaling may have timed out.
2015-06-05 17:14:21 -04:00