blib/lib/Paws/AutoScaling/CreateAutoScalingGroup.pm

filter: Statementstmt 100% 34 / 34 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 100% 36 / 36 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/Paws/AutoScaling/AutoScalingInstancesType.pm ↑ Summary blib/lib/Paws/AutoScaling/DescribeAdjustmentTypes.pm »
1  
2 package Paws::AutoScaling::CreateAutoScalingGroup;
3 1 ▶ use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 has AutoScalingGroupName => (is => 'ro', isa => 'Str', required => 1);
5 1 has AvailabilityZones => (is => 'ro', isa => 'ArrayRef[Str|Undef]');
6 1 has CapacityRebalance => (is => 'ro', isa => 'Bool');
7 1 has Context => (is => 'ro', isa => 'Str');
8 1 has DefaultCooldown => (is => 'ro', isa => 'Int');
9 1 has DesiredCapacity => (is => 'ro', isa => 'Int');
10 1 has HealthCheckGracePeriod => (is => 'ro', isa => 'Int');
11 1 has HealthCheckType => (is => 'ro', isa => 'Str');
12 1 has InstanceId => (is => 'ro', isa => 'Str');
13 1 has LaunchConfigurationName => (is => 'ro', isa => 'Str');
14 1 has LaunchTemplate => (is => 'ro', isa => 'Paws::AutoScaling::LaunchTemplateSpecification');
15 1 has LifecycleHookSpecificationList => (is => 'ro', isa => 'ArrayRef[Paws::AutoScaling::LifecycleHookSpecification]');
16 1 has LoadBalancerNames => (is => 'ro', isa => 'ArrayRef[Str|Undef]');
17 1 has MaxInstanceLifetime => (is => 'ro', isa => 'Int');
18 1 has MaxSize => (is => 'ro', isa => 'Int', required => 1);
19 1 has MinSize => (is => 'ro', isa => 'Int', required => 1);
20 1 has MixedInstancesPolicy => (is => 'ro', isa => 'Paws::AutoScaling::MixedInstancesPolicy');
21 1 has NewInstancesProtectedFromScaleIn => (is => 'ro', isa => 'Bool');
22 1 has PlacementGroup => (is => 'ro', isa => 'Str');
23 1 has ServiceLinkedRoleARN => (is => 'ro', isa => 'Str');
24 1 has Tags => (is => 'ro', isa => 'ArrayRef[Paws::AutoScaling::Tag]');
25 1 has TargetGroupARNs => (is => 'ro', isa => 'ArrayRef[Str|Undef]');
26 1 has TerminationPolicies => (is => 'ro', isa => 'ArrayRef[Str|Undef]');
27 1 has VPCZoneIdentifier => (is => 'ro', isa => 'Str');
28  
29 1 ▶ use MooseX::ClassAttribute;
Subroutine BEGIN: called CC=1 SCAR=0.0
30  
31 1 class_has _api_call => (isa => 'Str', is => 'ro', default => 'CreateAutoScalingGroup');
32 1 class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::API::Response');
33 1 class_has _result_key => (isa => 'Str', is => 'ro');
34 1 1;
35  
36 ### main pod documentation begin ###
37  
38 =head1 NAME
39  
40 Paws::AutoScaling::CreateAutoScalingGroup - Arguments for method CreateAutoScalingGroup on L<Paws::AutoScaling>
41  
42 =head1 DESCRIPTION
43  
44 This class represents the parameters used for calling the method CreateAutoScalingGroup on the
45 L<Auto Scaling|Paws::AutoScaling> service. Use the attributes of this class
46 as arguments to method CreateAutoScalingGroup.
47  
48 You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to CreateAutoScalingGroup.
49  
50 =head1 SYNOPSIS
51  
52 my $autoscaling = Paws->service('AutoScaling');
53 # To create an Auto Scaling group
54 # This example creates an Auto Scaling group.
55 $autoscaling->CreateAutoScalingGroup(
56 'AutoScalingGroupName' => 'my-auto-scaling-group',
57 'LaunchTemplate' => {
58 'LaunchTemplateId' => 'lt-0a20c965061f64abc',
59 'Version' => '$Latest'
60 },
61 'MaxInstanceLifetime' => 2592000,
62 'MaxSize' => 3,
63 'MinSize' => 1,
64 'VPCZoneIdentifier' => 'subnet-057fa0918fEXAMPLE'
65 );
66  
67 # To create an Auto Scaling group with an attached target group
68 # This example creates an Auto Scaling group and attaches the specified target
69 # group.
70 $autoscaling->CreateAutoScalingGroup(
71 'AutoScalingGroupName' => 'my-auto-scaling-group',
72 'HealthCheckGracePeriod' => 300,
73 'HealthCheckType' => 'ELB',
74 'LaunchTemplate' => {
75 'LaunchTemplateId' => 'lt-0a20c965061f64abc',
76 'Version' => '$Default'
77 },
78 'MaxSize' => 3,
79 'MinSize' => 1,
80 'TargetGroupARNs' => [
81 'arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067'
82 ],
83 'VPCZoneIdentifier' => 'subnet-057fa0918fEXAMPLE, subnet-610acd08EXAMPLE'
84 );
85  
86 # To create an Auto Scaling group with a mixed instances policy
87 # This example creates an Auto Scaling group with a mixed instances policy. It
88 # specifies the c5.large, c5a.large, and c6g.large instance types and defines a
89 # different launch template for the c6g.large instance type.
90 $autoscaling->CreateAutoScalingGroup(
91 'AutoScalingGroupName' => 'my-asg',
92 'DesiredCapacity' => 3,
93 'MaxSize' => 5,
94 'MinSize' => 1,
95 'MixedInstancesPolicy' => {
96 'InstancesDistribution' => {
97 'OnDemandBaseCapacity' => 1,
98 'OnDemandPercentageAboveBaseCapacity' => 50,
99 'SpotAllocationStrategy' => 'capacity-optimized'
100 },
101 'LaunchTemplate' => {
102 'LaunchTemplateSpecification' => {
103 'LaunchTemplateName' => 'my-launch-template-for-x86',
104 'Version' => '$Latest'
105 },
106 'Overrides' => [
107  
108 {
109 'InstanceType' => 'c6g.large',
110 'LaunchTemplateSpecification' => {
111 'LaunchTemplateName' => 'my-launch-template-for-arm',
112 'Version' => '$Latest'
113 }
114 },
115  
116 {
117 'InstanceType' => 'c5.large'
118 },
119  
120 {
121 'InstanceType' => 'c5a.large'
122 }
123 ]
124 }
125 },
126 'VPCZoneIdentifier' => 'subnet-057fa0918fEXAMPLE, subnet-610acd08EXAMPLE'
127 );
128  
129  
130 Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object.
131 For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/autoscaling/CreateAutoScalingGroup>
132  
133 =head1 ATTRIBUTES
134  
135  
136 =head2 B<REQUIRED> AutoScalingGroupName => Str
137  
138 The name of the Auto Scaling group. This name must be unique per Region
139 per account.
140  
141  
142  
143 =head2 AvailabilityZones => ArrayRef[Str|Undef]
144  
145 A list of Availability Zones where instances in the Auto Scaling group
146 can be created. This parameter is optional if you specify one or more
147 subnets for C<VPCZoneIdentifier>.
148  
149 Conditional: If your account supports EC2-Classic and VPC, this
150 parameter is required to launch instances into EC2-Classic.
151  
152  
153  
154 =head2 CapacityRebalance => Bool
155  
156 Indicates whether Capacity Rebalancing is enabled. Otherwise, Capacity
157 Rebalancing is disabled. When you turn on Capacity Rebalancing, Amazon
158 EC2 Auto Scaling attempts to launch a Spot Instance whenever Amazon EC2
159 notifies that a Spot Instance is at an elevated risk of interruption.
160 After launching a new instance, it then terminates an old instance. For
161 more information, see Amazon EC2 Auto Scaling Capacity Rebalancing
162 (https://docs.aws.amazon.com/autoscaling/ec2/userguide/capacity-rebalance.html)
163 in the I<Amazon EC2 Auto Scaling User Guide>.
164  
165  
166  
167 =head2 Context => Str
168  
169 Reserved.
170  
171  
172  
173 =head2 DefaultCooldown => Int
174  
175 The amount of time, in seconds, after a scaling activity completes
176 before another scaling activity can start. The default value is C<300>.
177 This setting applies when using simple scaling policies, but not when
178 using other scaling policies or scheduled scaling. For more
179 information, see Scaling cooldowns for Amazon EC2 Auto Scaling
180 (https://docs.aws.amazon.com/autoscaling/ec2/userguide/Cooldown.html)
181 in the I<Amazon EC2 Auto Scaling User Guide>.
182  
183  
184  
185 =head2 DesiredCapacity => Int
186  
187 The desired capacity is the initial capacity of the Auto Scaling group
188 at the time of its creation and the capacity it attempts to maintain.
189 It can scale beyond this capacity if you configure auto scaling. This
190 number must be greater than or equal to the minimum size of the group
191 and less than or equal to the maximum size of the group. If you do not
192 specify a desired capacity, the default is the minimum size of the
193 group.
194  
195  
196  
197 =head2 HealthCheckGracePeriod => Int
198  
199 The amount of time, in seconds, that Amazon EC2 Auto Scaling waits
200 before checking the health status of an EC2 instance that has come into
201 service. During this time, any health check failures for the instance
202 are ignored. The default value is C<0>. For more information, see
203 Health check grace period
204 (https://docs.aws.amazon.com/autoscaling/ec2/userguide/healthcheck.html#health-check-grace-period)
205 in the I<Amazon EC2 Auto Scaling User Guide>.
206  
207 Conditional: Required if you are adding an C<ELB> health check.
208  
209  
210  
211 =head2 HealthCheckType => Str
212  
213 The service to use for the health checks. The valid values are C<EC2>
214 (default) and C<ELB>. If you configure an Auto Scaling group to use
215 load balancer (ELB) health checks, it considers the instance unhealthy
216 if it fails either the EC2 status checks or the load balancer health
217 checks. For more information, see Health checks for Auto Scaling
218 instances
219 (https://docs.aws.amazon.com/autoscaling/ec2/userguide/healthcheck.html)
220 in the I<Amazon EC2 Auto Scaling User Guide>.
221  
222  
223  
224 =head2 InstanceId => Str
225  
226 The ID of the instance used to base the launch configuration on. If
227 specified, Amazon EC2 Auto Scaling uses the configuration values from
228 the specified instance to create a new launch configuration. To get the
229 instance ID, use the Amazon EC2 DescribeInstances
230 (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInstances.html)
231 API operation. For more information, see Creating an Auto Scaling group
232 using an EC2 instance
233 (https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-asg-from-instance.html)
234 in the I<Amazon EC2 Auto Scaling User Guide>.
235  
236  
237  
238 =head2 LaunchConfigurationName => Str
239  
240 The name of the launch configuration to use to launch instances.
241  
242 Conditional: You must specify either a launch template
243 (C<LaunchTemplate> or C<MixedInstancesPolicy>) or a launch
244 configuration (C<LaunchConfigurationName> or C<InstanceId>).
245  
246  
247  
248 =head2 LaunchTemplate => L<Paws::AutoScaling::LaunchTemplateSpecification>
249  
250 Parameters used to specify the launch template and version to use to
251 launch instances.
252  
253 Conditional: You must specify either a launch template
254 (C<LaunchTemplate> or C<MixedInstancesPolicy>) or a launch
255 configuration (C<LaunchConfigurationName> or C<InstanceId>).
256  
257 The launch template that is specified must be configured for use with
258 an Auto Scaling group. For more information, see Creating a launch
259 template for an Auto Scaling group
260 (https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-launch-template.html)
261 in the I<Amazon EC2 Auto Scaling User Guide>.
262  
263  
264  
265 =head2 LifecycleHookSpecificationList => ArrayRef[L<Paws::AutoScaling::LifecycleHookSpecification>]
266  
267 One or more lifecycle hooks for the group, which specify actions to
268 perform when Amazon EC2 Auto Scaling launches or terminates instances.
269  
270  
271  
272 =head2 LoadBalancerNames => ArrayRef[Str|Undef]
273  
274 A list of Classic Load Balancers associated with this Auto Scaling
275 group. For Application Load Balancers, Network Load Balancers, and
276 Gateway Load Balancers, specify the C<TargetGroupARNs> property
277 instead.
278  
279  
280  
281 =head2 MaxInstanceLifetime => Int
282  
283 The maximum amount of time, in seconds, that an instance can be in
284 service. The default is null. If specified, the value must be either 0
285 or a number equal to or greater than 86,400 seconds (1 day). For more
286 information, see Replacing Auto Scaling instances based on maximum
287 instance lifetime
288 (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-max-instance-lifetime.html)
289 in the I<Amazon EC2 Auto Scaling User Guide>.
290  
291  
292  
293 =head2 B<REQUIRED> MaxSize => Int
294  
295 The maximum size of the group.
296  
297 With a mixed instances policy that uses instance weighting, Amazon EC2
298 Auto Scaling may need to go above C<MaxSize> to meet your capacity
299 requirements. In this event, Amazon EC2 Auto Scaling will never go
300 above C<MaxSize> by more than your largest instance weight (weights
301 that define how many units each instance contributes to the desired
302 capacity of the group).
303  
304  
305  
306 =head2 B<REQUIRED> MinSize => Int
307  
308 The minimum size of the group.
309  
310  
311  
312 =head2 MixedInstancesPolicy => L<Paws::AutoScaling::MixedInstancesPolicy>
313  
314 An embedded object that specifies a mixed instances policy. The
315 required properties must be specified. If optional properties are
316 unspecified, their default values are used.
317  
318 The policy includes properties that not only define the distribution of
319 On-Demand Instances and Spot Instances, the maximum price to pay for
320 Spot Instances, and how the Auto Scaling group allocates instance types
321 to fulfill On-Demand and Spot capacities, but also the properties that
322 specify the instance configuration informationE<mdash>the launch
323 template and instance types. The policy can also include a weight for
324 each instance type and different launch templates for individual
325 instance types. For more information, see Auto Scaling groups with
326 multiple instance types and purchase options
327 (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-purchase-options.html)
328 in the I<Amazon EC2 Auto Scaling User Guide>.
329  
330  
331  
332 =head2 NewInstancesProtectedFromScaleIn => Bool
333  
334 Indicates whether newly launched instances are protected from
335 termination by Amazon EC2 Auto Scaling when scaling in. For more
336 information about preventing instances from terminating on scale in,
337 see Instance scale-in protection
338 (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-termination.html#instance-protection)
339 in the I<Amazon EC2 Auto Scaling User Guide>.
340  
341  
342  
343 =head2 PlacementGroup => Str
344  
345 The name of an existing placement group into which to launch your
346 instances, if any. A placement group is a logical grouping of instances
347 within a single Availability Zone. You cannot specify multiple
348 Availability Zones and a placement group. For more information, see
349 Placement Groups
350 (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html)
351 in the I<Amazon EC2 User Guide for Linux Instances>.
352  
353  
354  
355 =head2 ServiceLinkedRoleARN => Str
356  
357 The Amazon Resource Name (ARN) of the service-linked role that the Auto
358 Scaling group uses to call other Amazon Web Services on your behalf. By
359 default, Amazon EC2 Auto Scaling uses a service-linked role named
360 C<AWSServiceRoleForAutoScaling>, which it creates if it does not exist.
361 For more information, see Service-linked roles
362 (https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-service-linked-role.html)
363 in the I<Amazon EC2 Auto Scaling User Guide>.
364  
365  
366  
367 =head2 Tags => ArrayRef[L<Paws::AutoScaling::Tag>]
368  
369 One or more tags. You can tag your Auto Scaling group and propagate the
370 tags to the Amazon EC2 instances it launches. Tags are not propagated
371 to Amazon EBS volumes. To add tags to Amazon EBS volumes, specify the
372 tags in a launch template but use caution. If the launch template
373 specifies an instance tag with a key that is also specified for the
374 Auto Scaling group, Amazon EC2 Auto Scaling overrides the value of that
375 instance tag with the value specified by the Auto Scaling group. For
376 more information, see Tagging Auto Scaling groups and instances
377 (https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-tagging.html)
378 in the I<Amazon EC2 Auto Scaling User Guide>.
379  
380  
381  
382 =head2 TargetGroupARNs => ArrayRef[Str|Undef]
383  
384 The Amazon Resource Names (ARN) of the target groups to associate with
385 the Auto Scaling group. Instances are registered as targets in a target
386 group, and traffic is routed to the target group. For more information,
387 see Elastic Load Balancing and Amazon EC2 Auto Scaling
388 (https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-load-balancer.html)
389 in the I<Amazon EC2 Auto Scaling User Guide>.
390  
391  
392  
393 =head2 TerminationPolicies => ArrayRef[Str|Undef]
394  
395 A policy or a list of policies that are used to select the instance to
396 terminate. These policies are executed in the order that you list them.
397 For more information, see Controlling which Auto Scaling instances
398 terminate during scale in
399 (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-termination.html)
400 in the I<Amazon EC2 Auto Scaling User Guide>.
401  
402  
403  
404 =head2 VPCZoneIdentifier => Str
405  
406 A comma-separated list of subnet IDs for a virtual private cloud (VPC)
407 where instances in the Auto Scaling group can be created. If you
408 specify C<VPCZoneIdentifier> with C<AvailabilityZones>, the subnets
409 that you specify for this parameter must reside in those Availability
410 Zones.
411  
412 Conditional: If your account supports EC2-Classic and VPC, this
413 parameter is required to launch instances into a VPC.
414  
415  
416  
417  
418 =head1 SEE ALSO
419  
420 This class forms part of L<Paws>, documenting arguments for method CreateAutoScalingGroup in L<Paws::AutoScaling>
421  
422 =head1 BUGS and CONTRIBUTIONS
423  
424 The source code is located here: L<https://github.com/pplu/aws-sdk-perl>
425  
426 Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues>
427  
428 =cut
429  
« blib/lib/Paws/AutoScaling/AutoScalingInstancesType.pm ↑ Summary blib/lib/Paws/AutoScaling/DescribeAdjustmentTypes.pm »