blib/lib/Paws/ECS/CreateService.pm untested

filter: Statementstmt 0.0% 0 / 53 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 2 Podpod n/a totaltotal 0.0% 0 / 55 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1  
2 package Paws::ECS::CreateService;
3 use Moose;
4 has CapacityProviderStrategy => (is => 'ro', isa => 'ArrayRef[Paws::ECS::CapacityProviderStrategyItem]', traits => ['NameInRequest'], request_name => 'capacityProviderStrategy' );
5 has ClientToken => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'clientToken' );
6 has Cluster => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'cluster' );
7 has DeploymentConfiguration => (is => 'ro', isa => 'Paws::ECS::DeploymentConfiguration', traits => ['NameInRequest'], request_name => 'deploymentConfiguration' );
8 has DeploymentController => (is => 'ro', isa => 'Paws::ECS::DeploymentController', traits => ['NameInRequest'], request_name => 'deploymentController' );
9 has DesiredCount => (is => 'ro', isa => 'Int', traits => ['NameInRequest'], request_name => 'desiredCount' );
10 has EnableECSManagedTags => (is => 'ro', isa => 'Bool', traits => ['NameInRequest'], request_name => 'enableECSManagedTags' );
11 has EnableExecuteCommand => (is => 'ro', isa => 'Bool', traits => ['NameInRequest'], request_name => 'enableExecuteCommand' );
12 has HealthCheckGracePeriodSeconds => (is => 'ro', isa => 'Int', traits => ['NameInRequest'], request_name => 'healthCheckGracePeriodSeconds' );
13 has LaunchType => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'launchType' );
14 has LoadBalancers => (is => 'ro', isa => 'ArrayRef[Paws::ECS::LoadBalancer]', traits => ['NameInRequest'], request_name => 'loadBalancers' );
15 has NetworkConfiguration => (is => 'ro', isa => 'Paws::ECS::NetworkConfiguration', traits => ['NameInRequest'], request_name => 'networkConfiguration' );
16 has PlacementConstraints => (is => 'ro', isa => 'ArrayRef[Paws::ECS::PlacementConstraint]', traits => ['NameInRequest'], request_name => 'placementConstraints' );
17 has PlacementStrategy => (is => 'ro', isa => 'ArrayRef[Paws::ECS::PlacementStrategy]', traits => ['NameInRequest'], request_name => 'placementStrategy' );
18 has PlatformVersion => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'platformVersion' );
19 has PropagateTags => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'propagateTags' );
20 has Role => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'role' );
21 has SchedulingStrategy => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'schedulingStrategy' );
22 has ServiceName => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'serviceName' , required => 1);
23 has ServiceRegistries => (is => 'ro', isa => 'ArrayRef[Paws::ECS::ServiceRegistry]', traits => ['NameInRequest'], request_name => 'serviceRegistries' );
24 has Tags => (is => 'ro', isa => 'ArrayRef[Paws::ECS::Tag]', traits => ['NameInRequest'], request_name => 'tags' );
25 has TaskDefinition => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'taskDefinition' );
26  
27 use MooseX::ClassAttribute;
28  
29 class_has _api_call => (isa => 'Str', is => 'ro', default => 'CreateService');
30 class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::ECS::CreateServiceResponse');
31 class_has _result_key => (isa => 'Str', is => 'ro');
32 1;
33  
34 ### main pod documentation begin ###
35  
36 =head1 NAME
37  
38 Paws::ECS::CreateService - Arguments for method CreateService on L<Paws::ECS>
39  
40 =head1 DESCRIPTION
41  
42 This class represents the parameters used for calling the method CreateService on the
43 L<Amazon EC2 Container Service|Paws::ECS> service. Use the attributes of this class
44 as arguments to method CreateService.
45  
46 You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to CreateService.
47  
48 =head1 SYNOPSIS
49  
50 my $ecs = Paws->service('ECS');
51 # To create a new service
52 # This example creates a service in your default region called
53 # ``ecs-simple-service``. The service uses the ``hello_world`` task definition
54 # and it maintains 10 copies of that task.
55 my $CreateServiceResponse = $ecs->CreateService(
56 'DesiredCount' => 10,
57 'ServiceName' => 'ecs-simple-service',
58 'TaskDefinition' => 'hello_world'
59 );
60  
61 # Results:
62 my $service = $CreateServiceResponse->service;
63  
64 # Returns a L<Paws::ECS::CreateServiceResponse> object.
65 # To create a new service behind a load balancer
66 # This example creates a service in your default region called
67 # ``ecs-simple-service-elb``. The service uses the ``ecs-demo`` task definition
68 # and it maintains 10 copies of that task. You must reference an existing load
69 # balancer in the same region by its name.
70 my $CreateServiceResponse = $ecs->CreateService(
71 'DesiredCount' => 10,
72 'LoadBalancers' => [
73  
74 {
75 'ContainerName' => 'simple-app',
76 'ContainerPort' => 80,
77 'LoadBalancerName' => 'EC2Contai-EcsElast-15DCDAURT3ZO2'
78 }
79 ],
80 'Role' => 'ecsServiceRole',
81 'ServiceName' => 'ecs-simple-service-elb',
82 'TaskDefinition' => 'console-sample-app-static'
83 );
84  
85 # Results:
86 my $service = $CreateServiceResponse->service;
87  
88 # Returns a L<Paws::ECS::CreateServiceResponse> object.
89  
90 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.
91 For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/ecs/CreateService>
92  
93 =head1 ATTRIBUTES
94  
95  
96 =head2 CapacityProviderStrategy => ArrayRef[L<Paws::ECS::CapacityProviderStrategyItem>]
97  
98 The capacity provider strategy to use for the service.
99  
100 If a C<capacityProviderStrategy> is specified, the C<launchType>
101 parameter must be omitted. If no C<capacityProviderStrategy> or
102 C<launchType> is specified, the C<defaultCapacityProviderStrategy> for
103 the cluster is used.
104  
105  
106  
107 =head2 ClientToken => Str
108  
109 Unique, case-sensitive identifier that you provide to ensure the
110 idempotency of the request. Up to 32 ASCII characters are allowed.
111  
112  
113  
114 =head2 Cluster => Str
115  
116 The short name or full Amazon Resource Name (ARN) of the cluster on
117 which to run your service. If you do not specify a cluster, the default
118 cluster is assumed.
119  
120  
121  
122 =head2 DeploymentConfiguration => L<Paws::ECS::DeploymentConfiguration>
123  
124 Optional deployment parameters that control how many tasks run during
125 the deployment and the ordering of stopping and starting tasks.
126  
127  
128  
129 =head2 DeploymentController => L<Paws::ECS::DeploymentController>
130  
131 The deployment controller to use for the service. If no deployment
132 controller is specified, the default value of C<ECS> is used.
133  
134  
135  
136 =head2 DesiredCount => Int
137  
138 The number of instantiations of the specified task definition to place
139 and keep running on your cluster.
140  
141 This is required if C<schedulingStrategy> is C<REPLICA> or is not
142 specified. If C<schedulingStrategy> is C<DAEMON> then this is not
143 required.
144  
145  
146  
147 =head2 EnableECSManagedTags => Bool
148  
149 Specifies whether to enable Amazon ECS managed tags for the tasks
150 within the service. For more information, see Tagging Your Amazon ECS
151 Resources
152 (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-using-tags.html)
153 in the I<Amazon Elastic Container Service Developer Guide>.
154  
155  
156  
157 =head2 EnableExecuteCommand => Bool
158  
159 Whether or not the execute command functionality is enabled for the
160 service. If C<true>, this enables execute command functionality on all
161 containers in the service tasks.
162  
163  
164  
165 =head2 HealthCheckGracePeriodSeconds => Int
166  
167 The period of time, in seconds, that the Amazon ECS service scheduler
168 should ignore unhealthy Elastic Load Balancing target health checks
169 after a task has first started. This is only used when your service is
170 configured to use a load balancer. If your service has a load balancer
171 defined and you don't specify a health check grace period value, the
172 default value of C<0> is used.
173  
174 If your service's tasks take a while to start and respond to Elastic
175 Load Balancing health checks, you can specify a health check grace
176 period of up to 2,147,483,647 seconds. During that time, the Amazon ECS
177 service scheduler ignores health check status. This grace period can
178 prevent the service scheduler from marking tasks as unhealthy and
179 stopping them before they have time to come up.
180  
181  
182  
183 =head2 LaunchType => Str
184  
185 The infrastructure on which to run your service. For more information,
186 see Amazon ECS launch types
187 (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html)
188 in the I<Amazon Elastic Container Service Developer Guide>.
189  
190 The C<FARGATE> launch type runs your tasks on AWS Fargate On-Demand
191 infrastructure.
192  
193 Fargate Spot infrastructure is available for use but a capacity
194 provider strategy must be used. For more information, see AWS Fargate
195 capacity providers
196 (https://docs.aws.amazon.com/AmazonECS/latest/userguide/fargate-capacity-providers.html)
197 in the I<Amazon ECS User Guide for AWS Fargate>.
198  
199 The C<EC2> launch type runs your tasks on Amazon EC2 instances
200 registered to your cluster.
201  
202 The C<EXTERNAL> launch type runs your tasks on your on-premise server
203 or virtual machine (VM) capacity registered to your cluster.
204  
205 A service can use either a launch type or a capacity provider strategy.
206 If a C<launchType> is specified, the C<capacityProviderStrategy>
207 parameter must be omitted.
208  
209 Valid values are: C<"EC2">, C<"FARGATE">, C<"EXTERNAL">
210  
211 =head2 LoadBalancers => ArrayRef[L<Paws::ECS::LoadBalancer>]
212  
213 A load balancer object representing the load balancers to use with your
214 service. For more information, see Service Load Balancing
215 (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-load-balancing.html)
216 in the I<Amazon Elastic Container Service Developer Guide>.
217  
218 If the service is using the rolling update (C<ECS>) deployment
219 controller and using either an Application Load Balancer or Network
220 Load Balancer, you must specify one or more target group ARNs to attach
221 to the service. The service-linked role is required for services that
222 make use of multiple target groups. For more information, see Using
223 service-linked roles for Amazon ECS
224 (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using-service-linked-roles.html)
225 in the I<Amazon Elastic Container Service Developer Guide>.
226  
227 If the service is using the C<CODE_DEPLOY> deployment controller, the
228 service is required to use either an Application Load Balancer or
229 Network Load Balancer. When creating an AWS CodeDeploy deployment
230 group, you specify two target groups (referred to as a
231 C<targetGroupPair>). During a deployment, AWS CodeDeploy determines
232 which task set in your service has the status C<PRIMARY> and associates
233 one target group with it, and then associates the other target group
234 with the replacement task set. The load balancer can also have up to
235 two listeners: a required listener for production traffic and an
236 optional listener that allows you perform validation tests with Lambda
237 functions before routing production traffic to it.
238  
239 After you create a service using the C<ECS> deployment controller, the
240 load balancer name or target group ARN, container name, and container
241 port specified in the service definition are immutable. If you are
242 using the C<CODE_DEPLOY> deployment controller, these values can be
243 changed when updating the service.
244  
245 For Application Load Balancers and Network Load Balancers, this object
246 must contain the load balancer target group ARN, the container name (as
247 it appears in a container definition), and the container port to access
248 from the load balancer. The load balancer name parameter must be
249 omitted. When a task from this service is placed on a container
250 instance, the container instance and port combination is registered as
251 a target in the target group specified here.
252  
253 For Classic Load Balancers, this object must contain the load balancer
254 name, the container name (as it appears in a container definition), and
255 the container port to access from the load balancer. The target group
256 ARN parameter must be omitted. When a task from this service is placed
257 on a container instance, the container instance is registered with the
258 load balancer specified here.
259  
260 Services with tasks that use the C<awsvpc> network mode (for example,
261 those with the Fargate launch type) only support Application Load
262 Balancers and Network Load Balancers. Classic Load Balancers are not
263 supported. Also, when you create any target groups for these services,
264 you must choose C<ip> as the target type, not C<instance>, because
265 tasks that use the C<awsvpc> network mode are associated with an
266 elastic network interface, not an Amazon EC2 instance.
267  
268  
269  
270 =head2 NetworkConfiguration => L<Paws::ECS::NetworkConfiguration>
271  
272 The network configuration for the service. This parameter is required
273 for task definitions that use the C<awsvpc> network mode to receive
274 their own elastic network interface, and it is not supported for other
275 network modes. For more information, see Task networking
276 (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html)
277 in the I<Amazon Elastic Container Service Developer Guide>.
278  
279  
280  
281 =head2 PlacementConstraints => ArrayRef[L<Paws::ECS::PlacementConstraint>]
282  
283 An array of placement constraint objects to use for tasks in your
284 service. You can specify a maximum of 10 constraints per task (this
285 limit includes constraints in the task definition and those specified
286 at runtime).
287  
288  
289  
290 =head2 PlacementStrategy => ArrayRef[L<Paws::ECS::PlacementStrategy>]
291  
292 The placement strategy objects to use for tasks in your service. You
293 can specify a maximum of five strategy rules per service.
294  
295  
296  
297 =head2 PlatformVersion => Str
298  
299 The platform version that your tasks in the service are running on. A
300 platform version is specified only for tasks using the Fargate launch
301 type. If one isn't specified, the C<LATEST> platform version is used by
302 default. For more information, see AWS Fargate platform versions
303 (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html)
304 in the I<Amazon Elastic Container Service Developer Guide>.
305  
306  
307  
308 =head2 PropagateTags => Str
309  
310 Specifies whether to propagate the tags from the task definition or the
311 service to the tasks in the service. If no value is specified, the tags
312 are not propagated. Tags can only be propagated to the tasks within the
313 service during service creation. To add tags to a task after service
314 creation, use the TagResource API action.
315  
316 Valid values are: C<"TASK_DEFINITION">, C<"SERVICE">
317  
318 =head2 Role => Str
319  
320 The name or full Amazon Resource Name (ARN) of the IAM role that allows
321 Amazon ECS to make calls to your load balancer on your behalf. This
322 parameter is only permitted if you are using a load balancer with your
323 service and your task definition does not use the C<awsvpc> network
324 mode. If you specify the C<role> parameter, you must also specify a
325 load balancer object with the C<loadBalancers> parameter.
326  
327 If your account has already created the Amazon ECS service-linked role,
328 that role is used by default for your service unless you specify a role
329 here. The service-linked role is required if your task definition uses
330 the C<awsvpc> network mode or if the service is configured to use
331 service discovery, an external deployment controller, multiple target
332 groups, or Elastic Inference accelerators in which case you should not
333 specify a role here. For more information, see Using service-linked
334 roles for Amazon ECS
335 (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using-service-linked-roles.html)
336 in the I<Amazon Elastic Container Service Developer Guide>.
337  
338 If your specified role has a path other than C</>, then you must either
339 specify the full role ARN (this is recommended) or prefix the role name
340 with the path. For example, if a role with the name C<bar> has a path
341 of C</foo/> then you would specify C</foo/bar> as the role name. For
342 more information, see Friendly names and paths
343 (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-friendly-names)
344 in the I<IAM User Guide>.
345  
346  
347  
348 =head2 SchedulingStrategy => Str
349  
350 The scheduling strategy to use for the service. For more information,
351 see Services
352 (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_services.html).
353  
354 There are two service scheduler strategies available:
355  
356 =over
357  
358 =item *
359  
360 C<REPLICA>-The replica scheduling strategy places and maintains the
361 desired number of tasks across your cluster. By default, the service
362 scheduler spreads tasks across Availability Zones. You can use task
363 placement strategies and constraints to customize task placement
364 decisions. This scheduler strategy is required if the service is using
365 the C<CODE_DEPLOY> or C<EXTERNAL> deployment controller types.
366  
367 =item *
368  
369 C<DAEMON>-The daemon scheduling strategy deploys exactly one task on
370 each active container instance that meets all of the task placement
371 constraints that you specify in your cluster. The service scheduler
372 also evaluates the task placement constraints for running tasks and
373 will stop tasks that do not meet the placement constraints. When you're
374 using this strategy, you don't need to specify a desired number of
375 tasks, a task placement strategy, or use Service Auto Scaling policies.
376  
377 Tasks using the Fargate launch type or the C<CODE_DEPLOY> or
378 C<EXTERNAL> deployment controller types don't support the C<DAEMON>
379 scheduling strategy.
380  
381 =back
382  
383  
384 Valid values are: C<"REPLICA">, C<"DAEMON">
385  
386 =head2 B<REQUIRED> ServiceName => Str
387  
388 The name of your service. Up to 255 letters (uppercase and lowercase),
389 numbers, underscores, and hyphens are allowed. Service names must be
390 unique within a cluster, but you can have similarly named services in
391 multiple clusters within a Region or across multiple Regions.
392  
393  
394  
395 =head2 ServiceRegistries => ArrayRef[L<Paws::ECS::ServiceRegistry>]
396  
397 The details of the service discovery registry to associate with this
398 service. For more information, see Service discovery
399 (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html).
400  
401 Each service may be associated with one service registry. Multiple
402 service registries per service isn't supported.
403  
404  
405  
406 =head2 Tags => ArrayRef[L<Paws::ECS::Tag>]
407  
408 The metadata that you apply to the service to help you categorize and
409 organize them. Each tag consists of a key and an optional value, both
410 of which you define. When a service is deleted, the tags are deleted as
411 well.
412  
413 The following basic restrictions apply to tags:
414  
415 =over
416  
417 =item *
418  
419 Maximum number of tags per resource - 50
420  
421 =item *
422  
423 For each resource, each tag key must be unique, and each tag key can
424 have only one value.
425  
426 =item *
427  
428 Maximum key length - 128 Unicode characters in UTF-8
429  
430 =item *
431  
432 Maximum value length - 256 Unicode characters in UTF-8
433  
434 =item *
435  
436 If your tagging schema is used across multiple services and resources,
437 remember that other services may have restrictions on allowed
438 characters. Generally allowed characters are: letters, numbers, and
439 spaces representable in UTF-8, and the following characters: + - = . _
440 : / @.
441  
442 =item *
443  
444 Tag keys and values are case-sensitive.
445  
446 =item *
447  
448 Do not use C<aws:>, C<AWS:>, or any upper or lowercase combination of
449 such as a prefix for either keys or values as it is reserved for AWS
450 use. You cannot edit or delete tag keys or values with this prefix.
451 Tags with this prefix do not count against your tags per resource
452 limit.
453  
454 =back
455  
456  
457  
458  
459 =head2 TaskDefinition => Str
460  
461 The C<family> and C<revision> (C<family:revision>) or full ARN of the
462 task definition to run in your service. If a C<revision> is not
463 specified, the latest C<ACTIVE> revision is used.
464  
465 A task definition must be specified if the service is using either the
466 C<ECS> or C<CODE_DEPLOY> deployment controllers.
467  
468  
469  
470  
471 =head1 SEE ALSO
472  
473 This class forms part of L<Paws>, documenting arguments for method CreateService in L<Paws::ECS>
474  
475 =head1 BUGS and CONTRIBUTIONS
476  
477 The source code is located here: L<https://github.com/pplu/aws-sdk-perl>
478  
479 Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues>
480  
481 =cut
482