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

filter: Statementstmt 0.0% 0 / 41 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 2 Podpod n/a totaltotal 0.0% 0 / 43 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1  
2 package Paws::ECS::RegisterTaskDefinition;
3 use Moose;
4 has ContainerDefinitions => (is => 'ro', isa => 'ArrayRef[Paws::ECS::ContainerDefinition]', traits => ['NameInRequest'], request_name => 'containerDefinitions' , required => 1);
5 has Cpu => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'cpu' );
6 has EphemeralStorage => (is => 'ro', isa => 'Paws::ECS::EphemeralStorage', traits => ['NameInRequest'], request_name => 'ephemeralStorage' );
7 has ExecutionRoleArn => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'executionRoleArn' );
8 has Family => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'family' , required => 1);
9 has InferenceAccelerators => (is => 'ro', isa => 'ArrayRef[Paws::ECS::InferenceAccelerator]', traits => ['NameInRequest'], request_name => 'inferenceAccelerators' );
10 has IpcMode => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'ipcMode' );
11 has Memory => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'memory' );
12 has NetworkMode => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'networkMode' );
13 has PidMode => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'pidMode' );
14 has PlacementConstraints => (is => 'ro', isa => 'ArrayRef[Paws::ECS::TaskDefinitionPlacementConstraint]', traits => ['NameInRequest'], request_name => 'placementConstraints' );
15 has ProxyConfiguration => (is => 'ro', isa => 'Paws::ECS::ProxyConfiguration', traits => ['NameInRequest'], request_name => 'proxyConfiguration' );
16 has RequiresCompatibilities => (is => 'ro', isa => 'ArrayRef[Str|Undef]', traits => ['NameInRequest'], request_name => 'requiresCompatibilities' );
17 has Tags => (is => 'ro', isa => 'ArrayRef[Paws::ECS::Tag]', traits => ['NameInRequest'], request_name => 'tags' );
18 has TaskRoleArn => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'taskRoleArn' );
19 has Volumes => (is => 'ro', isa => 'ArrayRef[Paws::ECS::Volume]', traits => ['NameInRequest'], request_name => 'volumes' );
20  
21 use MooseX::ClassAttribute;
22  
23 class_has _api_call => (isa => 'Str', is => 'ro', default => 'RegisterTaskDefinition');
24 class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::ECS::RegisterTaskDefinitionResponse');
25 class_has _result_key => (isa => 'Str', is => 'ro');
26 1;
27  
28 ### main pod documentation begin ###
29  
30 =head1 NAME
31  
32 Paws::ECS::RegisterTaskDefinition - Arguments for method RegisterTaskDefinition on L<Paws::ECS>
33  
34 =head1 DESCRIPTION
35  
36 This class represents the parameters used for calling the method RegisterTaskDefinition on the
37 L<Amazon EC2 Container Service|Paws::ECS> service. Use the attributes of this class
38 as arguments to method RegisterTaskDefinition.
39  
40 You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to RegisterTaskDefinition.
41  
42 =head1 SYNOPSIS
43  
44 my $ecs = Paws->service('ECS');
45 # To register a task definition
46 # This example registers a task definition to the specified family.
47 my $RegisterTaskDefinitionResponse = $ecs->RegisterTaskDefinition(
48 'ContainerDefinitions' => [
49  
50 {
51 'Command' => [ 'sleep', 360 ],
52 'Cpu' => 10,
53 'Essential' => 1,
54 'Image' => 'busybox',
55 'Memory' => 10,
56 'Name' => 'sleep'
57 }
58 ],
59 'Family' => 'sleep360',
60 'TaskRoleArn' => '',
61 'Volumes' => [
62  
63 ]
64 );
65  
66 # Results:
67 my $taskDefinition = $RegisterTaskDefinitionResponse->taskDefinition;
68  
69 # Returns a L<Paws::ECS::RegisterTaskDefinitionResponse> object.
70  
71 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.
72 For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/ecs/RegisterTaskDefinition>
73  
74 =head1 ATTRIBUTES
75  
76  
77 =head2 B<REQUIRED> ContainerDefinitions => ArrayRef[L<Paws::ECS::ContainerDefinition>]
78  
79 A list of container definitions in JSON format that describe the
80 different containers that make up your task.
81  
82  
83  
84 =head2 Cpu => Str
85  
86 The number of CPU units used by the task. It can be expressed as an
87 integer using CPU units, for example C<1024>, or as a string using
88 vCPUs, for example C<1 vCPU> or C<1 vcpu>, in a task definition. String
89 values are converted to an integer indicating the CPU units when the
90 task definition is registered.
91  
92 Task-level CPU and memory parameters are ignored for Windows
93 containers. We recommend specifying container-level resources for
94 Windows containers.
95  
96 If you are using the EC2 launch type, this field is optional. Supported
97 values are between C<128> CPU units (C<0.125> vCPUs) and C<10240> CPU
98 units (C<10> vCPUs).
99  
100 If you are using the Fargate launch type, this field is required and
101 you must use one of the following values, which determines your range
102 of supported values for the C<memory> parameter:
103  
104 =over
105  
106 =item *
107  
108 256 (.25 vCPU) - Available C<memory> values: 512 (0.5 GB), 1024 (1 GB),
109 2048 (2 GB)
110  
111 =item *
112  
113 512 (.5 vCPU) - Available C<memory> values: 1024 (1 GB), 2048 (2 GB),
114 3072 (3 GB), 4096 (4 GB)
115  
116 =item *
117  
118 1024 (1 vCPU) - Available C<memory> values: 2048 (2 GB), 3072 (3 GB),
119 4096 (4 GB), 5120 (5 GB), 6144 (6 GB), 7168 (7 GB), 8192 (8 GB)
120  
121 =item *
122  
123 2048 (2 vCPU) - Available C<memory> values: Between 4096 (4 GB) and
124 16384 (16 GB) in increments of 1024 (1 GB)
125  
126 =item *
127  
128 4096 (4 vCPU) - Available C<memory> values: Between 8192 (8 GB) and
129 30720 (30 GB) in increments of 1024 (1 GB)
130  
131 =back
132  
133  
134  
135  
136 =head2 EphemeralStorage => L<Paws::ECS::EphemeralStorage>
137  
138 The amount of ephemeral storage to allocate for the task. This
139 parameter is used to expand the total amount of ephemeral storage
140 available, beyond the default amount, for tasks hosted on AWS Fargate.
141 For more information, see Fargate task storage
142 (https://docs.aws.amazon.com/AmazonECS/latest/userguide/using_data_volumes.html)
143 in the I<Amazon ECS User Guide for AWS Fargate>.
144  
145 This parameter is only supported for tasks hosted on AWS Fargate using
146 platform version C<1.4.0> or later.
147  
148  
149  
150 =head2 ExecutionRoleArn => Str
151  
152 The Amazon Resource Name (ARN) of the task execution role that grants
153 the Amazon ECS container agent permission to make AWS API calls on your
154 behalf. The task execution IAM role is required depending on the
155 requirements of your task. For more information, see Amazon ECS task
156 execution IAM role
157 (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_execution_IAM_role.html)
158 in the I<Amazon Elastic Container Service Developer Guide>.
159  
160  
161  
162 =head2 B<REQUIRED> Family => Str
163  
164 You must specify a C<family> for a task definition, which allows you to
165 track multiple versions of the same task definition. The C<family> is
166 used as a name for your task definition. Up to 255 letters (uppercase
167 and lowercase), numbers, underscores, and hyphens are allowed.
168  
169  
170  
171 =head2 InferenceAccelerators => ArrayRef[L<Paws::ECS::InferenceAccelerator>]
172  
173 The Elastic Inference accelerators to use for the containers in the
174 task.
175  
176  
177  
178 =head2 IpcMode => Str
179  
180 The IPC resource namespace to use for the containers in the task. The
181 valid values are C<host>, C<task>, or C<none>. If C<host> is specified,
182 then all containers within the tasks that specified the C<host> IPC
183 mode on the same container instance share the same IPC resources with
184 the host Amazon EC2 instance. If C<task> is specified, all containers
185 within the specified task share the same IPC resources. If C<none> is
186 specified, then IPC resources within the containers of a task are
187 private and not shared with other containers in a task or on the
188 container instance. If no value is specified, then the IPC resource
189 namespace sharing depends on the Docker daemon setting on the container
190 instance. For more information, see IPC settings
191 (https://docs.docker.com/engine/reference/run/#ipc-settings---ipc) in
192 the I<Docker run reference>.
193  
194 If the C<host> IPC mode is used, be aware that there is a heightened
195 risk of undesired IPC namespace expose. For more information, see
196 Docker security (https://docs.docker.com/engine/security/security/).
197  
198 If you are setting namespaced kernel parameters using C<systemControls>
199 for the containers in the task, the following will apply to your IPC
200 resource namespace. For more information, see System Controls
201 (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html)
202 in the I<Amazon Elastic Container Service Developer Guide>.
203  
204 =over
205  
206 =item *
207  
208 For tasks that use the C<host> IPC mode, IPC namespace related
209 C<systemControls> are not supported.
210  
211 =item *
212  
213 For tasks that use the C<task> IPC mode, IPC namespace related
214 C<systemControls> will apply to all containers within a task.
215  
216 =back
217  
218 This parameter is not supported for Windows containers or tasks run on
219 AWS Fargate.
220  
221 Valid values are: C<"host">, C<"task">, C<"none">
222  
223 =head2 Memory => Str
224  
225 The amount of memory (in MiB) used by the task. It can be expressed as
226 an integer using MiB, for example C<1024>, or as a string using GB, for
227 example C<1GB> or C<1 GB>, in a task definition. String values are
228 converted to an integer indicating the MiB when the task definition is
229 registered.
230  
231 Task-level CPU and memory parameters are ignored for Windows
232 containers. We recommend specifying container-level resources for
233 Windows containers.
234  
235 If using the EC2 launch type, this field is optional.
236  
237 If using the Fargate launch type, this field is required and you must
238 use one of the following values, which determines your range of
239 supported values for the C<cpu> parameter:
240  
241 =over
242  
243 =item *
244  
245 512 (0.5 GB), 1024 (1 GB), 2048 (2 GB) - Available C<cpu> values: 256
246 (.25 vCPU)
247  
248 =item *
249  
250 1024 (1 GB), 2048 (2 GB), 3072 (3 GB), 4096 (4 GB) - Available C<cpu>
251 values: 512 (.5 vCPU)
252  
253 =item *
254  
255 2048 (2 GB), 3072 (3 GB), 4096 (4 GB), 5120 (5 GB), 6144 (6 GB), 7168
256 (7 GB), 8192 (8 GB) - Available C<cpu> values: 1024 (1 vCPU)
257  
258 =item *
259  
260 Between 4096 (4 GB) and 16384 (16 GB) in increments of 1024 (1 GB) -
261 Available C<cpu> values: 2048 (2 vCPU)
262  
263 =item *
264  
265 Between 8192 (8 GB) and 30720 (30 GB) in increments of 1024 (1 GB) -
266 Available C<cpu> values: 4096 (4 vCPU)
267  
268 =back
269  
270  
271  
272  
273 =head2 NetworkMode => Str
274  
275 The Docker networking mode to use for the containers in the task. The
276 valid values are C<none>, C<bridge>, C<awsvpc>, and C<host>. If no
277 network mode is specified, the default is C<bridge>.
278  
279 For Amazon ECS tasks on Fargate, the C<awsvpc> network mode is
280 required. For Amazon ECS tasks on Amazon EC2 instances, any network
281 mode can be used. If the network mode is set to C<none>, you cannot
282 specify port mappings in your container definitions, and the tasks
283 containers do not have external connectivity. The C<host> and C<awsvpc>
284 network modes offer the highest networking performance for containers
285 because they use the EC2 network stack instead of the virtualized
286 network stack provided by the C<bridge> mode.
287  
288 With the C<host> and C<awsvpc> network modes, exposed container ports
289 are mapped directly to the corresponding host port (for the C<host>
290 network mode) or the attached elastic network interface port (for the
291 C<awsvpc> network mode), so you cannot take advantage of dynamic host
292 port mappings.
293  
294 When using the C<host> network mode, you should not run containers
295 using the root user (UID 0). It is considered best practice to use a
296 non-root user.
297  
298 If the network mode is C<awsvpc>, the task is allocated an elastic
299 network interface, and you must specify a NetworkConfiguration value
300 when you create a service or run a task with the task definition. For
301 more information, see Task Networking
302 (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html)
303 in the I<Amazon Elastic Container Service Developer Guide>.
304  
305 Currently, only Amazon ECS-optimized AMIs, other Amazon Linux variants
306 with the C<ecs-init> package, or AWS Fargate infrastructure support the
307 C<awsvpc> network mode.
308  
309 If the network mode is C<host>, you cannot run multiple instantiations
310 of the same task on a single container instance when port mappings are
311 used.
312  
313 Docker for Windows uses different network modes than Docker for Linux.
314 When you register a task definition with Windows containers, you must
315 not specify a network mode. If you use the console to register a task
316 definition with Windows containers, you must choose the
317 C<E<lt>defaultE<gt>> network mode object.
318  
319 For more information, see Network settings
320 (https://docs.docker.com/engine/reference/run/#network-settings) in the
321 I<Docker run reference>.
322  
323 Valid values are: C<"bridge">, C<"host">, C<"awsvpc">, C<"none">
324  
325 =head2 PidMode => Str
326  
327 The process namespace to use for the containers in the task. The valid
328 values are C<host> or C<task>. If C<host> is specified, then all
329 containers within the tasks that specified the C<host> PID mode on the
330 same container instance share the same process namespace with the host
331 Amazon EC2 instance. If C<task> is specified, all containers within the
332 specified task share the same process namespace. If no value is
333 specified, the default is a private namespace. For more information,
334 see PID settings
335 (https://docs.docker.com/engine/reference/run/#pid-settings---pid) in
336 the I<Docker run reference>.
337  
338 If the C<host> PID mode is used, be aware that there is a heightened
339 risk of undesired process namespace expose. For more information, see
340 Docker security (https://docs.docker.com/engine/security/security/).
341  
342 This parameter is not supported for Windows containers or tasks run on
343 AWS Fargate.
344  
345 Valid values are: C<"host">, C<"task">
346  
347 =head2 PlacementConstraints => ArrayRef[L<Paws::ECS::TaskDefinitionPlacementConstraint>]
348  
349 An array of placement constraint objects to use for the task. You can
350 specify a maximum of 10 constraints per task (this limit includes
351 constraints in the task definition and those specified at runtime).
352  
353  
354  
355 =head2 ProxyConfiguration => L<Paws::ECS::ProxyConfiguration>
356  
357 The configuration details for the App Mesh proxy.
358  
359 For tasks hosted on Amazon EC2 instances, the container instances
360 require at least version C<1.26.0> of the container agent and at least
361 version C<1.26.0-1> of the C<ecs-init> package to enable a proxy
362 configuration. If your container instances are launched from the Amazon
363 ECS-optimized AMI version C<20190301> or later, then they contain the
364 required versions of the container agent and C<ecs-init>. For more
365 information, see Amazon ECS-optimized AMI versions
366 (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-ami-versions.html)
367 in the I<Amazon Elastic Container Service Developer Guide>.
368  
369  
370  
371 =head2 RequiresCompatibilities => ArrayRef[Str|Undef]
372  
373 The task launch type that Amazon ECS should validate the task
374 definition against. A client exception is returned if the task
375 definition doesn't validate against the compatibilities specified. If
376 no value is specified, the parameter is omitted from the response.
377  
378  
379  
380 =head2 Tags => ArrayRef[L<Paws::ECS::Tag>]
381  
382 The metadata that you apply to the task definition to help you
383 categorize and organize them. Each tag consists of a key and an
384 optional value, both of which you define.
385  
386 The following basic restrictions apply to tags:
387  
388 =over
389  
390 =item *
391  
392 Maximum number of tags per resource - 50
393  
394 =item *
395  
396 For each resource, each tag key must be unique, and each tag key can
397 have only one value.
398  
399 =item *
400  
401 Maximum key length - 128 Unicode characters in UTF-8
402  
403 =item *
404  
405 Maximum value length - 256 Unicode characters in UTF-8
406  
407 =item *
408  
409 If your tagging schema is used across multiple services and resources,
410 remember that other services may have restrictions on allowed
411 characters. Generally allowed characters are: letters, numbers, and
412 spaces representable in UTF-8, and the following characters: + - = . _
413 : / @.
414  
415 =item *
416  
417 Tag keys and values are case-sensitive.
418  
419 =item *
420  
421 Do not use C<aws:>, C<AWS:>, or any upper or lowercase combination of
422 such as a prefix for either keys or values as it is reserved for AWS
423 use. You cannot edit or delete tag keys or values with this prefix.
424 Tags with this prefix do not count against your tags per resource
425 limit.
426  
427 =back
428  
429  
430  
431  
432 =head2 TaskRoleArn => Str
433  
434 The short name or full Amazon Resource Name (ARN) of the IAM role that
435 containers in this task can assume. All containers in this task are
436 granted the permissions that are specified in this role. For more
437 information, see IAM Roles for Tasks
438 (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html)
439 in the I<Amazon Elastic Container Service Developer Guide>.
440  
441  
442  
443 =head2 Volumes => ArrayRef[L<Paws::ECS::Volume>]
444  
445 A list of volume definitions in JSON format that containers in your
446 task may use.
447  
448  
449  
450  
451 =head1 SEE ALSO
452  
453 This class forms part of L<Paws>, documenting arguments for method RegisterTaskDefinition in L<Paws::ECS>
454  
455 =head1 BUGS and CONTRIBUTIONS
456  
457 The source code is located here: L<https://github.com/pplu/aws-sdk-perl>
458  
459 Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues>
460  
461 =cut
462