/
auto_scaling.ex
1333 lines (1020 loc) · 55.6 KB
/
auto_scaling.ex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# WARNING: DO NOT EDIT, AUTO-GENERATED CODE!
# See https://github.com/aws-beam/aws-codegen for more details.
defmodule AWS.AutoScaling do
@moduledoc """
Amazon EC2 Auto Scaling
Amazon EC2 Auto Scaling is designed to automatically launch and terminate EC2
instances based on user-defined scaling policies, scheduled actions, and health
checks.
For more information, see the [Amazon EC2 Auto Scaling User Guide](https://docs.aws.amazon.com/autoscaling/ec2/userguide/) and the [Amazon EC2 Auto Scaling API
Reference](https://docs.aws.amazon.com/autoscaling/ec2/APIReference/Welcome.html).
"""
alias AWS.Client
alias AWS.Request
def metadata do
%{
abbreviation: nil,
api_version: "2011-01-01",
content_type: "application/x-www-form-urlencoded",
credential_scope: nil,
endpoint_prefix: "autoscaling",
global?: false,
protocol: "query",
service_id: "Auto Scaling",
signature_version: "v4",
signing_name: "autoscaling",
target_prefix: nil
}
end
@doc """
Attaches one or more EC2 instances to the specified Auto Scaling group.
When you attach instances, Amazon EC2 Auto Scaling increases the desired
capacity of the group by the number of instances being attached. If the number
of instances being attached plus the desired capacity of the group exceeds the
maximum size of the group, the operation fails.
If there is a Classic Load Balancer attached to your Auto Scaling group, the
instances are also registered with the load balancer. If there are target groups
attached to your Auto Scaling group, the instances are also registered with the
target groups.
For more information, see [Attach EC2 instances to your Auto Scaling group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/attach-instance-asg.html)
in the *Amazon EC2 Auto Scaling User Guide*.
"""
def attach_instances(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "AttachInstances", input, options)
end
@doc """
This API operation is superseded by `AttachTrafficSources`, which can attach
multiple traffic sources types.
We recommend using `AttachTrafficSources` to simplify how you manage traffic
sources. However, we continue to support `AttachLoadBalancerTargetGroups`. You
can use both the original `AttachLoadBalancerTargetGroups` API operation and
`AttachTrafficSources` on the same Auto Scaling group.
Attaches one or more target groups to the specified Auto Scaling group.
This operation is used with the following load balancer types:
* Application Load Balancer - Operates at the application layer
(layer 7) and supports HTTP and HTTPS.
* Network Load Balancer - Operates at the transport layer (layer 4)
and supports TCP, TLS, and UDP.
* Gateway Load Balancer - Operates at the network layer (layer 3).
To describe the target groups for an Auto Scaling group, call the
`DescribeLoadBalancerTargetGroups` API. To detach the target group from the Auto
Scaling group, call the `DetachLoadBalancerTargetGroups` API.
This operation is additive and does not detach existing target groups or Classic
Load Balancers from the Auto Scaling group.
For more information, see [Use Elastic Load Balancing to distribute traffic across the instances in your Auto Scaling
group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-load-balancer.html)
in the *Amazon EC2 Auto Scaling User Guide*.
"""
def attach_load_balancer_target_groups(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "AttachLoadBalancerTargetGroups", input, options)
end
@doc """
This API operation is superseded by `AttachTrafficSources`, which can attach
multiple traffic sources types.
We recommend using `AttachTrafficSources` to simplify how you manage traffic
sources. However, we continue to support `AttachLoadBalancers`. You can use both
the original `AttachLoadBalancers` API operation and `AttachTrafficSources` on
the same Auto Scaling group.
Attaches one or more Classic Load Balancers to the specified Auto Scaling group.
Amazon EC2 Auto Scaling registers the running instances with these Classic Load
Balancers.
To describe the load balancers for an Auto Scaling group, call the
`DescribeLoadBalancers` API. To detach a load balancer from the Auto Scaling
group, call the `DetachLoadBalancers` API.
This operation is additive and does not detach existing Classic Load Balancers
or target groups from the Auto Scaling group.
For more information, see [Use Elastic Load Balancing to distribute traffic across the instances in your Auto Scaling
group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-load-balancer.html)
in the *Amazon EC2 Auto Scaling User Guide*.
"""
def attach_load_balancers(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "AttachLoadBalancers", input, options)
end
@doc """
Attaches one or more traffic sources to the specified Auto Scaling group.
You can use any of the following as traffic sources for an Auto Scaling group:
* Application Load Balancer
* Classic Load Balancer
* Gateway Load Balancer
* Network Load Balancer
* VPC Lattice
This operation is additive and does not detach existing traffic sources from the
Auto Scaling group.
After the operation completes, use the `DescribeTrafficSources` API to return
details about the state of the attachments between traffic sources and your Auto
Scaling group. To detach a traffic source from the Auto Scaling group, call the
`DetachTrafficSources` API.
"""
def attach_traffic_sources(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "AttachTrafficSources", input, options)
end
@doc """
Deletes one or more scheduled actions for the specified Auto Scaling group.
"""
def batch_delete_scheduled_action(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "BatchDeleteScheduledAction", input, options)
end
@doc """
Creates or updates one or more scheduled scaling actions for an Auto Scaling
group.
"""
def batch_put_scheduled_update_group_action(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "BatchPutScheduledUpdateGroupAction", input, options)
end
@doc """
Cancels an instance refresh or rollback that is in progress.
If an instance refresh or rollback is not in progress, an
`ActiveInstanceRefreshNotFound` error occurs.
This operation is part of the [instance refresh feature](https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-instance-refresh.html)
in Amazon EC2 Auto Scaling, which helps you update instances in your Auto
Scaling group after you make configuration changes.
When you cancel an instance refresh, this does not roll back any changes that it
made. Use the `RollbackInstanceRefresh` API to roll back instead.
"""
def cancel_instance_refresh(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "CancelInstanceRefresh", input, options)
end
@doc """
Completes the lifecycle action for the specified token or instance with the
specified result.
This step is a part of the procedure for adding a lifecycle hook to an Auto
Scaling group:
1. (Optional) Create a launch template or launch configuration with
a user data script that runs while an instance is in a wait state due to a
lifecycle hook.
2. (Optional) Create a Lambda function and a rule that allows Amazon
EventBridge to invoke your Lambda function when an instance is put into a wait
state due to a lifecycle hook.
3. (Optional) Create a notification target and an IAM role. The
target can be either an Amazon SQS queue or an Amazon SNS topic. The role allows
Amazon EC2 Auto Scaling to publish lifecycle notifications to the target.
4. Create the lifecycle hook. Specify whether the hook is used when
the instances launch or terminate.
5. If you need more time, record the lifecycle action heartbeat to
keep the instance in a wait state.
6. ## If you finish before the timeout period ends, send a callback
by using the `CompleteLifecycleAction` API call.
For more information, see [Complete a lifecycle action](https://docs.aws.amazon.com/autoscaling/ec2/userguide/completing-lifecycle-hooks.html)
in the *Amazon EC2 Auto Scaling User Guide*.
"""
def complete_lifecycle_action(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "CompleteLifecycleAction", input, options)
end
@doc """
## We strongly recommend using a launch template when calling this operation to
ensure full functionality for Amazon EC2 Auto Scaling and Amazon EC2.
Creates an Auto Scaling group with the specified name and attributes.
If you exceed your maximum limit of Auto Scaling groups, the call fails. To
query this limit, call the `DescribeAccountLimits` API. For information about
updating this limit, see [Quotas for Amazon EC2 Auto Scaling](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-quotas.html)
in the *Amazon EC2 Auto Scaling User Guide*.
For introductory exercises for creating an Auto Scaling group, see [Getting started with Amazon EC2 Auto
Scaling](https://docs.aws.amazon.com/autoscaling/ec2/userguide/GettingStartedTutorial.html)
and [Tutorial: Set up a scaled and load-balanced application](https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-register-lbs-with-asg.html)
in the *Amazon EC2 Auto Scaling User Guide*. For more information, see [Auto Scaling
groups](https://docs.aws.amazon.com/autoscaling/ec2/userguide/AutoScalingGroup.html)
in the *Amazon EC2 Auto Scaling User Guide*.
Every Auto Scaling group has three size properties (`DesiredCapacity`,
`MaxSize`, and `MinSize`). Usually, you set these sizes based on a specific
number of instances. However, if you configure a mixed instances policy that
defines weights for the instance types, you must specify these sizes with the
same units that you use for weighting instances.
"""
def create_auto_scaling_group(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "CreateAutoScalingGroup", input, options)
end
@doc """
Creates a launch configuration.
If you exceed your maximum limit of launch configurations, the call fails. To
query this limit, call the `DescribeAccountLimits` API. For information about
updating this limit, see [Quotas for Amazon EC2 Auto Scaling](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-quotas.html)
in the *Amazon EC2 Auto Scaling User Guide*.
For more information, see [Launch configurations](https://docs.aws.amazon.com/autoscaling/ec2/userguide/LaunchConfiguration.html)
in the *Amazon EC2 Auto Scaling User Guide*.
Amazon EC2 Auto Scaling configures instances launched as part of an Auto Scaling
group using either a launch template or a launch configuration. We strongly
recommend that you do not use launch configurations. They do not provide full
functionality for Amazon EC2 Auto Scaling or Amazon EC2. For information about
using launch templates, see [Launch templates](https://docs.aws.amazon.com/autoscaling/ec2/userguide/launch-templates.html)
in the *Amazon EC2 Auto Scaling User Guide*.
"""
def create_launch_configuration(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "CreateLaunchConfiguration", input, options)
end
@doc """
Creates or updates tags for the specified Auto Scaling group.
When you specify a tag with a key that already exists, the operation overwrites
the previous tag definition, and you do not get an error message.
For more information, see [Tag Auto Scaling groups and instances](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-tagging.html)
in the *Amazon EC2 Auto Scaling User Guide*.
"""
def create_or_update_tags(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "CreateOrUpdateTags", input, options)
end
@doc """
Deletes the specified Auto Scaling group.
If the group has instances or scaling activities in progress, you must specify
the option to force the deletion in order for it to succeed. The force delete
operation will also terminate the EC2 instances. If the group has a warm pool,
the force delete option also deletes the warm pool.
To remove instances from the Auto Scaling group before deleting it, call the
`DetachInstances` API with the list of instances and the option to decrement the
desired capacity. This ensures that Amazon EC2 Auto Scaling does not launch
replacement instances.
To terminate all instances before deleting the Auto Scaling group, call the
`UpdateAutoScalingGroup` API and set the minimum size and desired capacity of
the Auto Scaling group to zero.
If the group has scaling policies, deleting the group deletes the policies, the
underlying alarm actions, and any alarm that no longer has an associated action.
For more information, see [Delete your Auto Scaling infrastructure](https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-process-shutdown.html)
in the *Amazon EC2 Auto Scaling User Guide*.
"""
def delete_auto_scaling_group(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DeleteAutoScalingGroup", input, options)
end
@doc """
Deletes the specified launch configuration.
The launch configuration must not be attached to an Auto Scaling group. When
this call completes, the launch configuration is no longer available for use.
"""
def delete_launch_configuration(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DeleteLaunchConfiguration", input, options)
end
@doc """
Deletes the specified lifecycle hook.
If there are any outstanding lifecycle actions, they are completed first
(`ABANDON` for launching instances, `CONTINUE` for terminating instances).
"""
def delete_lifecycle_hook(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DeleteLifecycleHook", input, options)
end
@doc """
Deletes the specified notification.
"""
def delete_notification_configuration(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DeleteNotificationConfiguration", input, options)
end
@doc """
Deletes the specified scaling policy.
Deleting either a step scaling policy or a simple scaling policy deletes the
underlying alarm action, but does not delete the alarm, even if it no longer has
an associated action.
For more information, see [Deleting a scaling policy](https://docs.aws.amazon.com/autoscaling/ec2/userguide/deleting-scaling-policy.html)
in the *Amazon EC2 Auto Scaling User Guide*.
"""
def delete_policy(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DeletePolicy", input, options)
end
@doc """
Deletes the specified scheduled action.
"""
def delete_scheduled_action(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DeleteScheduledAction", input, options)
end
@doc """
Deletes the specified tags.
"""
def delete_tags(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DeleteTags", input, options)
end
@doc """
Deletes the warm pool for the specified Auto Scaling group.
For more information, see [Warm pools for Amazon EC2 Auto Scaling](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-warm-pools.html)
in the *Amazon EC2 Auto Scaling User Guide*.
"""
def delete_warm_pool(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DeleteWarmPool", input, options)
end
@doc """
Describes the current Amazon EC2 Auto Scaling resource quotas for your account.
When you establish an Amazon Web Services account, the account has initial
quotas on the maximum number of Auto Scaling groups and launch configurations
that you can create in a given Region. For more information, see [Quotas for Amazon EC2 Auto
Scaling](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-quotas.html)
in the *Amazon EC2 Auto Scaling User Guide*.
"""
def describe_account_limits(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DescribeAccountLimits", input, options)
end
@doc """
Describes the available adjustment types for step scaling and simple scaling
policies.
The following adjustment types are supported:
* `ChangeInCapacity`
* `ExactCapacity`
* `PercentChangeInCapacity`
"""
def describe_adjustment_types(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DescribeAdjustmentTypes", input, options)
end
@doc """
Gets information about the Auto Scaling groups in the account and Region.
If you specify Auto Scaling group names, the output includes information for
only the specified Auto Scaling groups. If you specify filters, the output
includes information for only those Auto Scaling groups that meet the filter
criteria. If you do not specify group names or filters, the output includes
information for all Auto Scaling groups.
This operation also returns information about instances in Auto Scaling groups.
To retrieve information about the instances in a warm pool, you must call the
`DescribeWarmPool` API.
"""
def describe_auto_scaling_groups(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DescribeAutoScalingGroups", input, options)
end
@doc """
Gets information about the Auto Scaling instances in the account and Region.
"""
def describe_auto_scaling_instances(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DescribeAutoScalingInstances", input, options)
end
@doc """
Describes the notification types that are supported by Amazon EC2 Auto Scaling.
"""
def describe_auto_scaling_notification_types(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DescribeAutoScalingNotificationTypes", input, options)
end
@doc """
Gets information about the instance refreshes for the specified Auto Scaling
group from the previous six weeks.
This operation is part of the [instance refresh feature](https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-instance-refresh.html)
in Amazon EC2 Auto Scaling, which helps you update instances in your Auto
Scaling group after you make configuration changes.
To help you determine the status of an instance refresh, Amazon EC2 Auto Scaling
returns information about the instance refreshes you previously initiated,
including their status, start time, end time, the percentage of the instance
refresh that is complete, and the number of instances remaining to update before
the instance refresh is complete. If a rollback is initiated while an instance
refresh is in progress, Amazon EC2 Auto Scaling also returns information about
the rollback of the instance refresh.
"""
def describe_instance_refreshes(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DescribeInstanceRefreshes", input, options)
end
@doc """
Gets information about the launch configurations in the account and Region.
"""
def describe_launch_configurations(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DescribeLaunchConfigurations", input, options)
end
@doc """
Describes the available types of lifecycle hooks.
The following hook types are supported:
* `autoscaling:EC2_INSTANCE_LAUNCHING`
* `autoscaling:EC2_INSTANCE_TERMINATING`
"""
def describe_lifecycle_hook_types(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DescribeLifecycleHookTypes", input, options)
end
@doc """
Gets information about the lifecycle hooks for the specified Auto Scaling group.
"""
def describe_lifecycle_hooks(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DescribeLifecycleHooks", input, options)
end
@doc """
This API operation is superseded by `DescribeTrafficSources`, which can describe
multiple traffic sources types.
We recommend using `DetachTrafficSources` to simplify how you manage traffic
sources. However, we continue to support `DescribeLoadBalancerTargetGroups`. You
can use both the original `DescribeLoadBalancerTargetGroups` API operation and
`DescribeTrafficSources` on the same Auto Scaling group.
Gets information about the Elastic Load Balancing target groups for the
specified Auto Scaling group.
To determine the attachment status of the target group, use the `State` element
in the response. When you attach a target group to an Auto Scaling group, the
initial `State` value is `Adding`. The state transitions to `Added` after all
Auto Scaling instances are registered with the target group. If Elastic Load
Balancing health checks are enabled for the Auto Scaling group, the state
transitions to `InService` after at least one Auto Scaling instance passes the
health check. When the target group is in the `InService` state, Amazon EC2 Auto
Scaling can terminate and replace any instances that are reported as unhealthy.
If no registered instances pass the health checks, the target group doesn't
enter the `InService` state.
Target groups also have an `InService` state if you attach them in the
`CreateAutoScalingGroup` API call. If your target group state is `InService`,
but it is not working properly, check the scaling activities by calling
`DescribeScalingActivities` and take any corrective actions necessary.
For help with failed health checks, see [Troubleshooting Amazon EC2 Auto Scaling: Health
checks](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ts-as-healthchecks.html)
in the *Amazon EC2 Auto Scaling User Guide*. For more information, see [Use Elastic Load Balancing to distribute traffic across the instances in your Auto
Scaling
group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-load-balancer.html)
in the *Amazon EC2 Auto Scaling User Guide*.
You can use this operation to describe target groups that were attached by using
`AttachLoadBalancerTargetGroups`, but not for target groups that were attached
by using `AttachTrafficSources`.
"""
def describe_load_balancer_target_groups(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DescribeLoadBalancerTargetGroups", input, options)
end
@doc """
This API operation is superseded by `DescribeTrafficSources`, which can describe
multiple traffic sources types.
We recommend using `DescribeTrafficSources` to simplify how you manage traffic
sources. However, we continue to support `DescribeLoadBalancers`. You can use
both the original `DescribeLoadBalancers` API operation and
`DescribeTrafficSources` on the same Auto Scaling group.
Gets information about the load balancers for the specified Auto Scaling group.
This operation describes only Classic Load Balancers. If you have Application
Load Balancers, Network Load Balancers, or Gateway Load Balancers, use the
`DescribeLoadBalancerTargetGroups` API instead.
To determine the attachment status of the load balancer, use the `State` element
in the response. When you attach a load balancer to an Auto Scaling group, the
initial `State` value is `Adding`. The state transitions to `Added` after all
Auto Scaling instances are registered with the load balancer. If Elastic Load
Balancing health checks are enabled for the Auto Scaling group, the state
transitions to `InService` after at least one Auto Scaling instance passes the
health check. When the load balancer is in the `InService` state, Amazon EC2
Auto Scaling can terminate and replace any instances that are reported as
unhealthy. If no registered instances pass the health checks, the load balancer
doesn't enter the `InService` state.
Load balancers also have an `InService` state if you attach them in the
`CreateAutoScalingGroup` API call. If your load balancer state is `InService`,
but it is not working properly, check the scaling activities by calling
`DescribeScalingActivities` and take any corrective actions necessary.
For help with failed health checks, see [Troubleshooting Amazon EC2 Auto Scaling: Health
checks](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ts-as-healthchecks.html)
in the *Amazon EC2 Auto Scaling User Guide*. For more information, see [Use Elastic Load Balancing to distribute traffic across the instances in your Auto
Scaling
group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-load-balancer.html)
in the *Amazon EC2 Auto Scaling User Guide*.
"""
def describe_load_balancers(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DescribeLoadBalancers", input, options)
end
@doc """
Describes the available CloudWatch metrics for Amazon EC2 Auto Scaling.
"""
def describe_metric_collection_types(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DescribeMetricCollectionTypes", input, options)
end
@doc """
Gets information about the Amazon SNS notifications that are configured for one
or more Auto Scaling groups.
"""
def describe_notification_configurations(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DescribeNotificationConfigurations", input, options)
end
@doc """
Gets information about the scaling policies in the account and Region.
"""
def describe_policies(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DescribePolicies", input, options)
end
@doc """
Gets information about the scaling activities in the account and Region.
When scaling events occur, you see a record of the scaling activity in the
scaling activities. For more information, see [Verifying a scaling activity for an Auto Scaling
group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-verify-scaling-activity.html)
in the *Amazon EC2 Auto Scaling User Guide*.
If the scaling event succeeds, the value of the `StatusCode` element in the
response is `Successful`. If an attempt to launch instances failed, the
`StatusCode` value is `Failed` or `Cancelled` and the `StatusMessage` element in
the response indicates the cause of the failure. For help interpreting the
`StatusMessage`, see [Troubleshooting Amazon EC2 Auto Scaling](https://docs.aws.amazon.com/autoscaling/ec2/userguide/CHAP_Troubleshooting.html)
in the *Amazon EC2 Auto Scaling User Guide*.
"""
def describe_scaling_activities(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DescribeScalingActivities", input, options)
end
@doc """
Describes the scaling process types for use with the `ResumeProcesses` and
`SuspendProcesses` APIs.
"""
def describe_scaling_process_types(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DescribeScalingProcessTypes", input, options)
end
@doc """
Gets information about the scheduled actions that haven't run or that have not
reached their end time.
To describe the scaling activities for scheduled actions that have already run,
call the `DescribeScalingActivities` API.
"""
def describe_scheduled_actions(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DescribeScheduledActions", input, options)
end
@doc """
Describes the specified tags.
You can use filters to limit the results. For example, you can query for the
tags for a specific Auto Scaling group. You can specify multiple values for a
filter. A tag must match at least one of the specified values for it to be
included in the results.
You can also specify multiple filters. The result includes information for a
particular tag only if it matches all the filters. If there's no match, no
special message is returned.
For more information, see [Tag Auto Scaling groups and instances](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-tagging.html)
in the *Amazon EC2 Auto Scaling User Guide*.
"""
def describe_tags(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DescribeTags", input, options)
end
@doc """
Describes the termination policies supported by Amazon EC2 Auto Scaling.
For more information, see [Work with Amazon EC2 Auto Scaling termination policies](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-termination-policies.html)
in the *Amazon EC2 Auto Scaling User Guide*.
"""
def describe_termination_policy_types(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DescribeTerminationPolicyTypes", input, options)
end
@doc """
Gets information about the traffic sources for the specified Auto Scaling group.
You can optionally provide a traffic source type. If you provide a traffic
source type, then the results only include that traffic source type.
If you do not provide a traffic source type, then the results include all the
traffic sources for the specified Auto Scaling group.
"""
def describe_traffic_sources(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DescribeTrafficSources", input, options)
end
@doc """
Gets information about a warm pool and its instances.
For more information, see [Warm pools for Amazon EC2 Auto Scaling](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-warm-pools.html)
in the *Amazon EC2 Auto Scaling User Guide*.
"""
def describe_warm_pool(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DescribeWarmPool", input, options)
end
@doc """
Removes one or more instances from the specified Auto Scaling group.
After the instances are detached, you can manage them independent of the Auto
Scaling group.
If you do not specify the option to decrement the desired capacity, Amazon EC2
Auto Scaling launches instances to replace the ones that are detached.
If there is a Classic Load Balancer attached to the Auto Scaling group, the
instances are deregistered from the load balancer. If there are target groups
attached to the Auto Scaling group, the instances are deregistered from the
target groups.
For more information, see [Detach EC2 instances from your Auto Scaling group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/detach-instance-asg.html)
in the *Amazon EC2 Auto Scaling User Guide*.
"""
def detach_instances(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DetachInstances", input, options)
end
@doc """
This API operation is superseded by `DetachTrafficSources`, which can detach
multiple traffic sources types.
We recommend using `DetachTrafficSources` to simplify how you manage traffic
sources. However, we continue to support `DetachLoadBalancerTargetGroups`. You
can use both the original `DetachLoadBalancerTargetGroups` API operation and
`DetachTrafficSources` on the same Auto Scaling group.
Detaches one or more target groups from the specified Auto Scaling group.
When you detach a target group, it enters the `Removing` state while
deregistering the instances in the group. When all instances are deregistered,
then you can no longer describe the target group using the
`DescribeLoadBalancerTargetGroups` API call. The instances remain running.
You can use this operation to detach target groups that were attached by using
`AttachLoadBalancerTargetGroups`, but not for target groups that were attached
by using `AttachTrafficSources`.
"""
def detach_load_balancer_target_groups(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DetachLoadBalancerTargetGroups", input, options)
end
@doc """
This API operation is superseded by `DetachTrafficSources`, which can detach
multiple traffic sources types.
We recommend using `DetachTrafficSources` to simplify how you manage traffic
sources. However, we continue to support `DetachLoadBalancers`. You can use both
the original `DetachLoadBalancers` API operation and `DetachTrafficSources` on
the same Auto Scaling group.
Detaches one or more Classic Load Balancers from the specified Auto Scaling
group.
This operation detaches only Classic Load Balancers. If you have Application
Load Balancers, Network Load Balancers, or Gateway Load Balancers, use the
`DetachLoadBalancerTargetGroups` API instead.
When you detach a load balancer, it enters the `Removing` state while
deregistering the instances in the group. When all instances are deregistered,
then you can no longer describe the load balancer using the
`DescribeLoadBalancers` API call. The instances remain running.
"""
def detach_load_balancers(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DetachLoadBalancers", input, options)
end
@doc """
Detaches one or more traffic sources from the specified Auto Scaling group.
When you detach a traffic source, it enters the `Removing` state while
deregistering the instances in the group. When all instances are deregistered,
then you can no longer describe the traffic source using the
`DescribeTrafficSources` API call. The instances continue to run.
"""
def detach_traffic_sources(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DetachTrafficSources", input, options)
end
@doc """
Disables group metrics collection for the specified Auto Scaling group.
"""
def disable_metrics_collection(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "DisableMetricsCollection", input, options)
end
@doc """
Enables group metrics collection for the specified Auto Scaling group.
You can use these metrics to track changes in an Auto Scaling group and to set
alarms on threshold values. You can view group metrics using the Amazon EC2 Auto
Scaling console or the CloudWatch console. For more information, see [Monitor CloudWatch metrics for your Auto Scaling groups and
instances](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-cloudwatch-monitoring.html)
in the *Amazon EC2 Auto Scaling User Guide*.
"""
def enable_metrics_collection(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "EnableMetricsCollection", input, options)
end
@doc """
Moves the specified instances into the standby state.
If you choose to decrement the desired capacity of the Auto Scaling group, the
instances can enter standby as long as the desired capacity of the Auto Scaling
group after the instances are placed into standby is equal to or greater than
the minimum capacity of the group.
If you choose not to decrement the desired capacity of the Auto Scaling group,
the Auto Scaling group launches new instances to replace the instances on
standby.
For more information, see [Temporarily removing instances from your Auto Scaling group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-enter-exit-standby.html)
in the *Amazon EC2 Auto Scaling User Guide*.
"""
def enter_standby(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "EnterStandby", input, options)
end
@doc """
Executes the specified policy.
This can be useful for testing the design of your scaling policy.
"""
def execute_policy(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "ExecutePolicy", input, options)
end
@doc """
Moves the specified instances out of the standby state.
After you put the instances back in service, the desired capacity is
incremented.
For more information, see [Temporarily removing instances from your Auto Scaling group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-enter-exit-standby.html)
in the *Amazon EC2 Auto Scaling User Guide*.
"""
def exit_standby(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "ExitStandby", input, options)
end
@doc """
Retrieves the forecast data for a predictive scaling policy.
Load forecasts are predictions of the hourly load values using historical load
data from CloudWatch and an analysis of historical trends. Capacity forecasts
are represented as predicted values for the minimum capacity that is needed on
an hourly basis, based on the hourly load forecast.
A minimum of 24 hours of data is required to create the initial forecasts.
However, having a full 14 days of historical data results in more accurate
forecasts.
For more information, see [Predictive scaling for Amazon EC2 Auto Scaling](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-predictive-scaling.html)
in the *Amazon EC2 Auto Scaling User Guide*.
"""
def get_predictive_scaling_forecast(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "GetPredictiveScalingForecast", input, options)
end
@doc """
Creates or updates a lifecycle hook for the specified Auto Scaling group.
Lifecycle hooks let you create solutions that are aware of events in the Auto
Scaling instance lifecycle, and then perform a custom action on instances when
the corresponding lifecycle event occurs.
This step is a part of the procedure for adding a lifecycle hook to an Auto
Scaling group:
1. (Optional) Create a launch template or launch configuration with
a user data script that runs while an instance is in a wait state due to a
lifecycle hook.
2. (Optional) Create a Lambda function and a rule that allows Amazon
EventBridge to invoke your Lambda function when an instance is put into a wait
state due to a lifecycle hook.
3. (Optional) Create a notification target and an IAM role. The
target can be either an Amazon SQS queue or an Amazon SNS topic. The role allows
Amazon EC2 Auto Scaling to publish lifecycle notifications to the target.
4. ## Create the lifecycle hook. Specify whether the hook is used
when the instances launch or terminate.
5. If you need more time, record the lifecycle action heartbeat to
keep the instance in a wait state using the `RecordLifecycleActionHeartbeat` API
call.
6. If you finish before the timeout period ends, send a callback by
using the `CompleteLifecycleAction` API call.
For more information, see [Amazon EC2 Auto Scaling lifecycle hooks](https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html)
in the *Amazon EC2 Auto Scaling User Guide*.
If you exceed your maximum limit of lifecycle hooks, which by default is 50 per
Auto Scaling group, the call fails.
You can view the lifecycle hooks for an Auto Scaling group using the
`DescribeLifecycleHooks` API call. If you are no longer using a lifecycle hook,
you can delete it by calling the `DeleteLifecycleHook` API.
"""
def put_lifecycle_hook(%Client{} = client, input, options \\ []) do
meta = metadata()
Request.request_post(client, meta, "PutLifecycleHook", input, options)
end
@doc """
Configures an Auto Scaling group to send notifications when specified events
take place.
Subscribers to the specified topic can have messages delivered to an endpoint
such as a web server or an email address.
This configuration overwrites any existing configuration.
For more information, see [Getting Amazon SNS notifications when your Auto Scaling group
scales](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ASGettingNotifications.html)
in the *Amazon EC2 Auto Scaling User Guide*.
If you exceed your maximum limit of SNS topics, which is 10 per Auto Scaling
group, the call fails.
"""
def put_notification_configuration(%Client{} = client, input, options \\ []) do
meta = metadata()