-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.yaml
607 lines (606 loc) · 24.2 KB
/
config.yaml
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
---
cog_bundle_version: 4
name: ecs
description: AWS EC2 Container Service
version: 0.0.1
docker:
image: cogcmd/aws-ecs
tag: 0.0.1
commands:
container-define:
executable: "/home/bundle/cog-command"
description: Creates a new container definition.
arguments: "<name> <image>"
options:
cpu:
type: int
required: false
description: The number of cpu units reserved for the container.
memory:
type: int
required: false
description: The hard limit (in MiB) of memory to present to the container.
memory-reservation:
type: int
required: false
description: The soft limit (in MiB) of memory to reserve for the container.
link:
type: list
required: false
description: The link parameter allows containers to communicate with each
other without the need for port mappings, using the name parameter and optionally,
an alias for the link. Can be specified multiple times.
port-mapping:
type: list
required: false
description: The list of port mappings for the container. Specified as 'tcp|udp:container_port:host_port'.
Can be specified multiple times.
essential:
type: bool
required: false
description: If the essential parameter of a container is marked as true,
and that container fails or stops for any reason, all other containers that
are part of the task are stopped.
entry-point:
type: string
required: false
description: |-
An ENTRYPOINT allows you to configure a container that will run as an executable.
Note: The entrypoint is passed to ECS as an array. The argument will be split on ' '. So for example: '--entrypoint "echo foo"' would be passed as ["echo", "foo"].
command:
type: string
required: false
description: |-
The command that is passed to the container.
Note: Like entrypoint the command is passed to ECS as an array.
env:
type: list
required: false
description: The environment variables to pass to a container. Specified as
'key=value'. Can be specified multiple times
mount-point:
type: list
required: false
description: The mount points for data volumes in your container. Specified
as 'source_volume:container_path:read_only'. If not specified 'read_only'
defaults to 'false'. Can be specified multiple times.
volume-from:
type: list
required: false
description: Data volumes to mount from another container. Specified as 'source_container:read_only'.
If not specified 'read_only' defaults to 'false'. Can be specified multiple
times.
hostname:
type: string
required: false
description: The hostname to use for the container.
user:
type: string
required: false
description: The user name to use inside the container.
working-directory:
type: string
required: false
description: The working directory in which to run commands inside the container.
disable-networking:
type: bool
required: false
description: When this parameter is true, networking is disabled within the
container. Defaults to 'false'.
privileged:
type: bool
required: false
description: When this parameter is true, the container is given elevated
privileges on the host container instance (similar to the root user). Defaults
to 'false'.
readonly-root-filesystem:
type: bool
required: false
description: When this parameter is true, the container is given read-only
access to its root file system. Defaults to 'false'.
dns-server:
type: list
required: false
description: A DNS server that is presented to the container. Can be specified
multiple times.
dns-search-domain:
type: list
required: false
description: A DNS search domain that is presented to the container. Can be
specified multiple times.
extra-host:
type: list
required: false
description: Hostname and IP address mapping to append to the /etc/hosts file
on the container. Specified as 'hostname:ip_address'. Can be specified multiple
times.
docker-security-option:
type: list
required: false
description: A string to provide a custom label for SELinux and AppArmor multi-level
security systems. Can be specified multiple times.
docker-label:
type: list
required: false
description: A key/value map of labels to add to the container. Specified
as 'key=value'. Can be specified multiple times.
ulimit:
type: list
required: false
description: |-
A ulimit to set in the container. Specified as 'name:soft_limit:hard_limit'.
Note: name can be one of [core, cpu, data, fsize, locks, memlock, msgqueue, nice, nofile, nproc, rss, rtprio, rttime, sigpending, stack]. Can be specified multiple times.
log-configuration:
type: string
required: false
description: |-
The log configuration specification for the container. Specified as 'log_driver:key1=value1:key2=value2:...'.
Note: log_driver and be one of [json-file, syslog, journald, gelf, fluentd, awslogs, splunk]
rules:
- must have ecs:container
container-update:
executable: "/home/bundle/cog-command"
description: Updates container definitions.
arguments: "<name>"
options:
image:
type: string
required: false
short_flag: i
description: The image used to start a container.
cpu:
type: int
required: false
description: The number of cpu units reserved for the container.
memory:
type: int
required: false
description: The hard limit (in MiB) of memory to present to the container.
memory-reservation:
type: int
required: false
description: The soft limit (in MiB) of memory to reserve for the container.
link:
type: list
required: false
description: The link parameter allows containers to communicate with each
other without the need for port mappings, using the name parameter and optionally,
an alias for the link. Can be specified multiple times.
port-mapping:
type: list
required: false
description: The list of port mappings for the container. Specified as 'tcp|udp:container_port:host_port'.
Can be specified multiple times.
essential:
type: bool
required: false
description: If the essential parameter of a container is marked as true,
and that container fails or stops for any reason, all other containers that
are part of the task are stopped.
entry-point:
type: string
required: false
description: |-
An ENTRYPOINT allows you to configure a container that will run as an executable.
Note: The entrypoint is passed to ECS as an array. The argument will be split on ' '. So for example: '--entrypoint "echo foo"' would be passed as ["echo", "foo"].
command:
type: string
required: false
description: |-
The command that is passed to the container.
Note: Like entrypoint the command is passed to ECS as an array.
env:
type: list
required: false
description: The environment variables to pass to a container. Specified as
'key=value'. Can be specified multiple times
mount-point:
type: list
required: false
description: The mount points for data volumes in your container. Specified
as 'source_volume:container_path:read_only'. If not specified 'read_only'
defaults to 'false'. Can be specified multiple times.
volume-from:
type: list
required: false
description: Data volumes to mount from another container. Specified as 'source_container:read_only'.
If not specified 'read_only' defaults to 'false'. Can be specified multiple
times.
hostname:
type: string
required: false
description: The hostname to use for the container.
user:
type: string
required: false
description: The user name to use inside the container.
working-directory:
type: string
required: false
description: The working directory in which to run commands inside the container.
disable-networking:
type: bool
required: false
description: When this parameter is true, networking is disabled within the
container. Defaults to 'false'.
privileged:
type: bool
required: false
description: When this parameter is true, the container is given elevated
privileges on the host container instance (similar to the root user). Defaults
to 'false'.
readonly-root-filesystem:
type: bool
required: false
description: When this parameter is true, the container is given read-only
access to its root file system. Defaults to 'false'.
dns-server:
type: list
required: false
description: A DNS server that is presented to the container. Can be specified
multiple times.
dns-search-domain:
type: list
required: false
description: A DNS search domain that is presented to the container. Can be
specified multiple times.
extra-host:
type: list
required: false
description: Hostname and IP address mapping to append to the /etc/hosts file
on the container. Specified as 'hostname:ip_address'. Can be specified multiple
times.
docker-security-option:
type: list
required: false
description: A string to provide a custom label for SELinux and AppArmor multi-level
security systems. Can be specified multiple times.
docker-label:
type: list
required: false
description: A key/value map of labels to add to the container. Specified
as 'key=value'. Can be specified multiple times.
ulimit:
type: list
required: false
description: |-
A ulimit to set in the container. Specified as 'name:soft_limit:hard_limit'.
Note: name can be one of [core, cpu, data, fsize, locks, memlock, msgqueue, nice, nofile, nproc, rss, rtprio, rttime, sigpending, stack]. Can be specified multiple times.
log-configuration:
type: string
required: false
description: |-
The log configuration specification for the container. Specified as 'log_driver:key1=value1:key2=value2:...'.
Note: log_driver can be one of [json-file, syslog, journald, gelf, fluentd, awslogs, splunk]
rules:
- must have ecs:container
container-list:
executable: "/home/bundle/cog-command"
description: Lists container definitions.
rules:
- must have ecs:container
container-show:
executable: "/home/bundle/cog-command"
description: Shows json body of a container definition.
arguments: "<name>"
rules:
- must have ecs:container
container-delete:
executable: "/home/bundle/cog-command"
description: Deletes container definitions.
arguments: "<name>"
rules:
- must have ecs:container
task-families:
executable: "/home/bundle/cog-command"
description: Lists task definition families optionally filtered by a family prefix.
arguments: "[family_prefix]"
options:
limit:
type: int
required: false
short_flag: l
description: Limit results.
inactive:
type: bool
required: false
short_flag: i
description: Return inactive task definition families. By default active task
definition families are returned.
rules:
- must have ecs:task
task-revisions:
executable: "/home/bundle/cog-command"
description: Lists task definition revisions.
arguments: "<family_name>"
options:
limit:
type: int
required: false
short_flag: l
description: Limit results.
inactive:
type: bool
required: false
short_flag: i
description: Return inactive task definition revisions. By default active
task definition revisions are returned.
rules:
- must have ecs:task
task-register:
executable: "/home/bundle/cog-command"
description: Registers a new task definition.
long_description: 'Note: Definitions are container definition names as listed
by ecs:container list.'
arguments: "<family> <def1 | def2 | ...>"
options:
role:
type: string
required: false
short_flag: r
description: IAM Role for containers in this task to assume
network-mode:
type: string
required: false
short_flag: m
description: Docker networking mode. One of (bridge, host, none)
volume:
type: list
required: false
short_flag: v
description: Volume definition defined as 'name:path' (Can be specified multiple
times)
replace-volumes:
type: bool
required: false
description: |-
When true existing volumes are replaced.
Note: Only valid with --use-previous-revision By default if a volume is declared with the same name it is replaced otherwise the volume is appended to the list.
use-previous-revision:
type: bool
required: false
short_flag: p
description: Use the previous revision as a base.
replace-definitions:
type: bool
required: false
description: |-
When true existing container definitions are replaced.
Note: Only valid with --use-previous-revision By default definitions are only replaced if one with the same name is specified. Otherwise definitions are appended to the list.
rules:
- must have ecs:task
task-deregister:
executable: "/home/bundle/cog-command"
description: Deregisters a task definition.
arguments: "<family:revision>"
rules:
- must have ecs:task
task-show:
executable: "/home/bundle/cog-command"
description: Shows the task definition.
long_description: 'Note: You can supply the family and revision or just the family.
If you supply just the family the latest active revision in the family will
be assumed.'
arguments: "<family | family:revision>"
rules:
- must have ecs:task
service-list:
executable: "/home/bundle/cog-command"
description: Lists services running in the specified cluster.
long_description: |-
Lists services running in the specified cluster.
Note: If no cluster is specified, the default cluster is assumed.
arguments: "[cluster]"
options:
limit:
type: int
required: false
short_flag: l
description: At max only return this many results.
rules:
- must have ecs:service
service-delete:
executable: "/home/bundle/cog-command"
description: Deletes the specified service within a cluster.
long_description: |-
Deletes the specified service within a cluster.
Note: The service must have desired count and running count of 0 before you can delete it.
arguments: "<service_name>"
options:
cluster:
type: string
required: false
short_flag: c
description: The short name or full Amazon Resource Name (ARN) of the cluster
on which to your service is running. If you do not specify a cluster, the
default cluster is assumed.
rules:
- must have ecs:service
service-create:
executable: "/home/bundle/cog-command"
description: Runs and maintains a desired number of tasks from a specified task
definition.
long_description: |-
Runs and maintains a desired number of tasks from a specified task definition. If the number of tasks running in a service drops below desired_count, Amazon ECS spawns another instantiation of the task in the specified cluster.
Note: desired_count defaults to 1
In addition to maintaining the desired count of tasks in your service, you can optionally run your service behind a load balancer. The load balancer distributes traffic across the tasks that are associated with the service.
arguments: "<service_name> <task_definition> <desired_count>"
options:
cluster:
type: string
required: false
short_flag: c
description: The short name or full Amazon Resource Name (ARN) of the cluster
on which to run your service. If you do not specify a cluster, the default
cluster is assumed.
deployment-config:
type: string
required: false
short_flag: d
description: Optional deployment parameters that control how many tasks run
during the deployment and the ordering of stopping and starting tasks. Specified
as 'minimum_healthy_percent:maximum_percent'.
load-balancer:
type: string
required: false
short_flag: l
description: |-
Specifies a load balancer to user with your service.
For Elastic Load Balancing Classic load balancers, this object must contain the container name (as it appears in a container definition), the container port to access from the load balancer, and the load balancer name. Specified as 'container_name:container_port:load_balancer_name'. When a task from this service is placed on a container instance, the container instance is registered with the load balancer specified here.
For Elastic Load Balancing Application load balancers, this object must contain the container name (as it appears in a container definition), the container port to access from the load balancer, and the load balancer target group ARN. Specified as 'container_name:container_port:target_group_arn'. When a task from this service is placed on a container instance, the container instance and port combination is registered as a target in the target group specified here.
role:
type: string
required: false
short_flag: r
description: The name or full Amazon Resource Name (ARN) of the IAM role that
allows Amazon ECS to make calls to your load balancer on your behalf. This
parameter is required if you are using a load balancer with your service.
If you specify the role option, you must also specify a load balancer object
with the load-balancer option.
rules:
- must have ecs:service
service-update:
executable: "/home/bundle/cog-command"
description: Modifies the desired count, deployment configuration, or task definition
used in a service.
arguments: "<service_name>"
options:
task-definition:
type: string
required: false
short_flag: t
description: The task definition to run in your service.
desired-count:
type: int
required: false
short_flag: d
description: The number of instantiations of the task to place and keep running
in your service.
cluster:
type: string
required: false
short_flag: c
description: The short name or full Amazon Resource Name (ARN) of the cluster
on which to run your service. If you do not specify a cluster, the default
cluster is assumed.
deployment-config:
type: string
required: false
short_flag: d
description: Optional deployment parameters that control how many tasks run
during the deployment and the ordering of stopping and starting tasks. Specified
as 'minimum_healthy_percent:maximum_percent'.
load-balancer:
type: string
required: false
short_flag: l
description: |-
Specifies a load balancer to user with your service.
For Elastic Load Balancing Classic load balancers, this object must contain the container name (as it appears in a container definition), the container port to access from the load balancer, and the load balancer name. Specified as 'container_name:container_port:load_balancer_name'. When a task from this service is placed on a container instance, the container instance is registered with the load balancer specified here.
For Elastic Load Balancing Application load balancers, this object must contain the container name (as it appears in a container definition), the container port to access from the load balancer, and the load balancer target group ARN. Specified as 'container_name:container_port:target_group_arn'. When a task from this service is placed on a container instance, the container instance and port combination is registered as a target in the target group specified here.
role:
type: string
required: false
short_flag: r
description: The name or full Amazon Resource Name (ARN) of the IAM role that
allows Amazon ECS to make calls to your load balancer on your behalf. This
parameter is required if you are using a load balancer with your service.
If you specify the role option, you must also specify a load balancer object
with the load-balancer option.
rules:
- must have ecs:service
service-show:
executable: "/home/bundle/cog-command"
description: Shows a service.
arguments: "<service_name>"
options:
cluster:
type: string
required: false
short_flag: c
description: The short name or full Amazon Resource Name (ARN) of the cluster
on which to run your service. If you do not specify a cluster, the default
cluster is assumed.
rules:
- must have ecs:service
permissions:
- ecs:container
- ecs:task
- ecs:service
templates:
definition_table:
body: |
~attachment title="Container Definitions" color="darkblue"~
| Name | Last Modified |
| ---- | ------------- |
~each var=$results as=definition~| ~$definition.name~ | ~$definition.last_modified~ |
~end~
~end~
definition_show:
body: |
~each var=$results as=definition~
~attachment title=$definition.name color="mediumblue"~
_Image:_ ~$definition.image~
~end~
~attachment title="Definition Body" color="darkblue"~
~json var=$definition~
~end~
~end~
definition_delete:
body: |
~each var=$results as=definition~
Deleted ~$definition.name~
~end~
task_show:
body: |
~each var=$results as=task~
~attachment title=$task.family color="blue"~
_Revision:_ ~$task.revision~
_Status:_ ~$task.status~
_ARN:_ ~$task.task_definition_arn~
~end~
~if cond=$task.volumes not_empty?~
~attachment title="Volumes" color="mediumblue"~
~json var=$task.volumes~
~end~
~end~
~attachment title="Container Definitions" color="darkblue"~
~json var=$task.container_definitions~
~end~
~end~
service_table:
body: |
| Name | ARN |
| ---- | --- |
~each var=$results as=service~
| ~$service.name~ | ~$service.arn~ |
~end~
service_show:
body: |
~each var=$results as=service~
~attachment title=$service.service_name color="lightblue"~
_Status:_ ~$service.status~
~end~
~attachment title="Counts" color="mediumblue"~
| Desired | Running | Pending |
| ------- | ------- | ------- |
| ~$service.desired_count~ | ~$service.running_count~ | ~$service.pending_count~ |
~end~
~attachment title="Json Body" color="darkblue"~
~json var=$service~
~end~
~end~
task_family_list:
body: |
| Task Definition Family | Status |
|------------------------|--------|
~each var=$results as=task~
| ~$task.task_definition_family~ | ~$task.status~ |
~end~
task_revision_list:
body: |+
| Task Definition Revision | Status |
|--------------------------|--------|
~each var=$results as=task~
| ~$task.task_definition_revision~ | ~$task.status~ |
~end~