-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
Copy pathcopilot.ts
2318 lines (2308 loc) · 79.6 KB
/
copilot.ts
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
import YAML from "yaml";
const applicationName: Fig.Generator = {
script: ["cat", "copilot/.workspace"],
// TODO: I feel like there's a better way to do this.
// There's only ever expected to be one `application` key.
postProcess: (output) => {
if (output.trim() == "") {
return [];
}
const suggestions: Fig.Suggestion[] = [];
try {
const application = YAML.parse(output).application;
suggestions.push({
name: `${application}`,
icon: "fig://icon?type=aws",
}) as Fig.Suggestion;
} catch (e) {
console.log(e);
return [];
}
return suggestions;
},
};
const appOptionGenerated: Fig.Option = {
name: ["--app", "-a"],
description: "Name of the application",
args: { name: "name", generators: applicationName },
};
const envNameOptionGenerated: Fig.Option = {
name: ["--name", "-n"],
description: "Name of the environment",
// TODO: Add generator for environment names.
// Run `copilot env ls --json` and parse the output for the `applicationName`
args: { name: "name" },
};
const svcNameOptionGenerated: Fig.Option = {
name: ["--name", "-n"],
description: "Name of the service",
// TODO: Add generator for service names.
// Run `copilot svc ls --json` and parse the output for the `applicationName`
args: { name: "name" },
};
const helpOption: Fig.Option = {
name: ["--help", "-h"],
description: "Help for command",
};
const jsonOption: Fig.Option = {
name: "--json",
description: "Outputs in JSON format",
};
const yesOption: Fig.Option = {
name: "--yes",
description: "Skips confirmation prompt",
};
const completionSpec: Fig.Spec = {
name: "copilot",
description: "👩✈️ Launch and manage containerized applications on AWS",
subcommands: [
{
name: "init",
description: "Create a new ECS or App Runner application",
options: [
{
name: ["--app", "-a"],
description: "Name of the application",
args: { name: "app" }, // can't be generated, new app name
},
{
name: "--deploy",
description: 'Deploy your service or job to a "test" environment',
},
{
name: ["--dockerfile", "-d"],
description: "Path to the Dockerfile",
args: { name: "dockerfile" },
exclusiveOn: ["--image", "-i"],
},
{
name: ["--image", "-i"],
description: "The location of an existing Docker image",
args: { name: "image" },
exclusiveOn: ["--dockerfile", "-d"],
},
{
name: ["--name", "-n"],
description: "Name of the service or job",
args: { name: "name" },
},
{
name: "--port",
description: "The port on which your service listens",
args: { name: "port", default: "0" },
},
{
name: "--retries",
description:
"Optional. The number of times to try restarting the job on a failure",
args: { name: "retries", default: "0" },
},
{
name: "--schedule",
description:
'The schedule on which to run this job. Accepts cron expressions of the format (M H DoM M DoW) and schedule definition strings. For example: "0 * * * *", "@daily", "@weekly", "@every 1h30m". AWS Schedule Expressions of the form "rate(10 minutes)" or "cron(0 12 L * ? 2021)" are also accepted',
args: { name: "schedule" },
},
{
name: "--tag",
description: "Optional. The container image tag",
args: { name: "tag" },
},
{
name: "--timeout",
description:
'Optional. The total execution time for the task, including retries. Accepts valid Go duration strings. For example: "2h", "1h30m", "900s"',
args: { name: "timeout" },
},
{
name: ["--type", "-t"],
description: "Type of job or svc to create",
args: {
name: "type",
suggestions: [
"Request-Driven Web Service",
"Load Balanced Web Service",
"Backend Service",
"Worker Service",
"Scheduled Job",
],
},
},
helpOption,
],
},
{
name: "docs",
description: "Open the copilot docs",
options: [helpOption],
},
{
name: "app",
description:
"Commands for applications. Applications are a collection of services and environments",
subcommands: [
{
name: "init",
description: "Creates a new empty application",
options: [
{
name: "--domain",
description: "Optional. Your existing custom domain name",
args: { name: "domain" },
},
{
name: "--resource-tags",
description:
"Optional. Labels with a key and value separated by commas. Allows you to categorize resources",
args: { name: "resource-tags" },
},
helpOption,
],
},
{
name: "ls",
description: "Lists all the applications in your account",
options: [helpOption],
},
{
name: "show",
description: "Shows info about an application",
options: [
jsonOption,
{
name: ["--name", "-n"],
description: "Name of the application",
args: { name: "name" },
},
helpOption,
],
},
{
name: "delete",
description: "Delete all resources associated with the application",
options: [
{
name: ["--name", "-n"],
description: "Name of the application",
args: { name: "name" },
},
yesOption,
helpOption,
],
},
{
name: "upgrade",
description:
"Upgrades the template of an application to the latest version",
options: [
{
name: ["--name", "-n"],
description: "Name of the application",
args: { name: "name" },
},
helpOption,
],
},
],
options: [helpOption],
},
{
name: "env",
description:
"Commands for environments. Environments are deployment stages shared between services",
subcommands: [
{
name: "init",
description: "Creates a new environment in your application",
options: [
appOptionGenerated,
{
name: "--aws-access-key-id",
description: "Optional. An AWS access key",
args: { name: "aws-access-key-id" },
},
{
name: "--aws-secret-access-key",
description: "Optional. An AWS secret access key",
args: { name: "aws-secret-access-key" },
},
{
name: "--aws-session-token",
description:
"Optional. An AWS session token for temporary credentials",
args: { name: "aws-session-token" },
},
{
name: "--default-config",
description:
"Optional. Skip prompting and use default environment configuration",
},
{
name: "--import-private-subnets",
description: "Optional. Use existing private subnet IDs",
args: { name: "import-private-subnets" },
},
{
name: "--import-public-subnets",
description: "Optional. Use existing public subnet IDs",
args: { name: "import-public-subnets" },
},
{
name: "--import-vpc-id",
description: "Optional. Use an existing VPC ID",
args: { name: "import-vpc-id" },
},
{
name: ["--name", "-n"],
description: "Name of the environment",
args: { name: "name" },
},
{
name: "--override-az-names",
description:
"Optional. Availability Zone names. (default 2 random AZs)",
args: { name: "override-az-names" },
},
{
name: "--override-private-cidrs",
description:
"Optional. CIDR to use for private subnets. (default 10.0.2.0/24,10.0.3.0/24)",
args: { name: "override-private-cidrs" },
},
{
name: "--override-public-cidrs",
description:
"Optional. CIDR to use for public subnets. (default 10.0.0.0/24,10.0.1.0/24)",
args: { name: "override-public-cidrs" },
},
{
name: "--override-vpc-cidr",
description:
"Optional. Global CIDR to use for VPC. (default 10.0.0.0/16)",
args: { name: "override-vpc-cidr", default: "<nil>" },
},
{
name: "--prod",
description: "If the environment contains production services",
},
{
name: "--profile",
description: "Name of the profile",
args: { name: "profile" },
},
{
name: "--region",
description:
"Optional. An AWS region where the environment will be created",
args: { name: "region" },
},
helpOption,
],
},
{
name: "ls",
description: "Lists all the environments in an application",
options: [appOptionGenerated, jsonOption, helpOption],
},
{
name: "delete",
description: "Deletes an environment from your application",
options: [
appOptionGenerated,
{
name: ["--name", "-n"],
description: "Name of the environment",
args: { name: "name" },
},
yesOption,
helpOption,
],
},
{
name: "show",
description: "Shows info about a deployed environment",
options: [
appOptionGenerated,
jsonOption,
{
name: ["--name", "-n"],
description: "Name of the environment",
args: { name: "name" },
},
{
name: "--resources",
description: "Optional. Show the resources in your environment",
},
helpOption,
],
},
],
options: [helpOption],
},
{
name: "svc",
description:
"Commands for services. Services are long-running ECS or App Runner services",
subcommands: [
{
name: "init",
description: "Creates a new service in an application",
options: [
appOptionGenerated,
{
name: ["--dockerfile", "-d"],
description: "Path to the Dockerfile",
args: { name: "dockerfile" },
exclusiveOn: ["--image", "-i"],
},
{
name: ["--image", "-i"],
description: "The location of an existing Docker image",
args: { name: "image" },
exclusiveOn: ["--dockerfile", "-d"],
},
svcNameOptionGenerated,
{
name: "--no-subscribe",
description:
"Optional. Turn off selection for adding subscriptions for worker services",
},
{
name: "--port",
description: "The port on which your service listens",
args: { name: "port", default: "0" },
},
{
name: "--subscribe-topics",
description:
"Optional. SNS Topics to subscribe to from other services in your application. Must be of format '<svcName>:<topicName>'",
isRepeatable: true,
args: { name: "subscribe-topics" },
},
{
name: ["--svc-type", "-t"],
description: "Type of service to create",
args: {
name: "svc-type",
suggestions: [
"Request-Driven Web Service",
"Load Balanced Web Service",
"Backend Service",
"Worker Service",
],
},
},
helpOption,
],
},
{
name: "ls",
description: "Lists all the services in an application",
options: [
appOptionGenerated,
jsonOption,
{
name: "--local",
description: "Only show services in the workspace",
},
helpOption,
],
},
{
name: "package",
description: "Prints the AWS CloudFormation template of a service",
options: [
appOptionGenerated,
envNameOptionGenerated,
svcNameOptionGenerated,
{
name: "--output-dir",
description:
"Optional. Writes the stack template and template configuration to a directory",
args: { name: "output-dir" },
},
{
name: "--tag",
description: "Optional. The container image tag",
args: { name: "tag" },
},
helpOption,
],
},
{
name: "deploy",
description: "Deploys a service to an environment",
options: [
appOptionGenerated,
envNameOptionGenerated,
{
name: "--force",
description:
"Optional. Force a new service deployment using the existing image",
},
svcNameOptionGenerated,
{
name: "--resource-tags",
description:
"Optional. Labels with a key and value separated by commas. Allows you to categorize resources",
args: { name: "resource-tags" },
},
{
name: "--tag",
description: "Optional. The container image tag",
args: { name: "tag" },
},
helpOption,
],
},
{
name: "delete",
description: "Deletes a service from an application",
options: [
appOptionGenerated,
envNameOptionGenerated,
svcNameOptionGenerated,
yesOption,
helpOption,
],
},
{
name: "show",
description: "Shows info about a deployed service per environment",
options: [
appOptionGenerated,
jsonOption,
svcNameOptionGenerated,
{
name: "--resources",
description: "Optional. Show the resources in your service",
},
helpOption,
],
},
{
name: "status",
description: "Shows status of a deployed service",
options: [
appOptionGenerated,
envNameOptionGenerated,
jsonOption,
svcNameOptionGenerated,
helpOption,
],
},
{
name: "logs",
description: "Displays logs of a deployed service",
options: [
appOptionGenerated,
{
name: "--end-time",
description:
"Optional. Only return logs before a specific date (RFC3339). Defaults to all logs",
args: { name: "end-time" },
exclusiveOn: ["--follow"],
},
envNameOptionGenerated,
{
name: "--follow",
description: "Optional. Specifies if the logs should be streamed",
exclusiveOn: ["--end-time"],
},
jsonOption,
{
name: "--limit",
description:
"Optional. The maximum number of log events returned. Default is 10 unless any time filtering flags are set",
args: { name: "limit", default: "0" },
},
{
name: "--log-group",
description: "Optional. Only return logs from specific log group",
args: { name: "log-group" },
},
svcNameOptionGenerated,
{
name: "--since",
description:
"Optional. Only return logs newer than a relative duration like 5s, 2m, or 3h. Defaults to all logs",
args: { name: "since", default: "0s" },
exclusiveOn: ["--start-time"],
},
{
name: "--start-time",
description:
"Optional. Only return logs after a specific date (RFC3339). Defaults to all logs",
args: { name: "start-time" },
exclusiveOn: ["--since"],
},
{
name: "--tasks",
description: "Optional. Only return logs from specific task IDs",
args: { name: "tasks" },
},
helpOption,
],
},
{
name: "exec",
description:
"Execute a command in a running container part of a service",
options: [
appOptionGenerated,
{
name: ["--command", "-c"],
description:
"Optional. The command that is passed to a running container",
args: { name: "command", default: "/bin/sh" },
},
{
name: "--container",
description:
"Optional. The specific container you want to exec in. By default the first essential container will be used",
args: { name: "container" },
},
envNameOptionGenerated,
{
name: ["--name", "-n"],
description: "Name of the service, job, or task group",
args: { name: "name" },
},
{
name: "--task-id",
description: "Optional. ID of the task you want to exec in",
args: { name: "task-id" },
},
{
name: "--yes",
description:
"Optional. Whether to update the Session Manager Plugin",
},
helpOption,
],
},
{
name: "pause",
description: "Pause running App Runner service",
options: [
appOptionGenerated,
envNameOptionGenerated,
svcNameOptionGenerated,
yesOption,
helpOption,
],
},
{
name: "resume",
description: "Resumes a paused service",
options: [
appOptionGenerated,
envNameOptionGenerated,
svcNameOptionGenerated,
helpOption,
],
},
],
options: [helpOption],
},
{
name: "job",
description:
"Commands for jobs. Jobs are tasks that are triggered by events",
subcommands: [
{
name: "init",
description: "Creates a new scheduled job in an application",
options: [
appOptionGenerated,
{
name: ["--dockerfile", "-d"],
description: "Path to the Dockerfile",
args: { name: "dockerfile" },
exclusiveOn: ["--image", "-i"],
},
{
name: ["--image", "-i"],
description: "The location of an existing Docker image",
args: { name: "image" },
exclusiveOn: ["--dockerfile", "-d"],
},
{
name: ["--job-type", "-t"],
description: "Type of job to create",
args: { name: "job-type", suggestions: ["Scheduled Job"] },
},
{
name: ["--name", "-n"],
description: "Name of the job",
args: { name: "name" },
},
{
name: "--retries",
description:
"Optional. The number of times to try restarting the job on a failure",
args: { name: "retries", default: "0" },
},
{
name: ["--schedule", "-s"],
description:
'The schedule on which to run this job. Accepts cron expressions of the format (M H DoM M DoW) and schedule definition strings. For example: "0 * * * *", "@daily", "@weekly", "@every 1h30m". AWS Schedule Expressions of the form "rate(10 minutes)" or "cron(0 12 L * ? 2021)" are also accepted',
args: { name: "schedule" },
},
{
name: "--timeout",
description:
'Optional. The total execution time for the task, including retries. Accepts valid Go duration strings. For example: "2h", "1h30m", "900s"',
args: { name: "timeout" },
},
helpOption,
],
},
{
name: "ls",
description: "Lists all the jobs in an application",
options: [
appOptionGenerated,
jsonOption,
{
name: "--local",
description: "Only show jobs in the workspace",
},
helpOption,
],
},
{
name: "package",
description: "Prints the AWS CloudFormation template of a job",
options: [
appOptionGenerated,
envNameOptionGenerated,
{
name: ["--name", "-n"],
description: "Name of the job",
args: { name: "name" },
},
{
name: "--output-dir",
description:
"Optional. Writes the stack template and template configuration to a directory",
args: { name: "output-dir" },
},
{
name: "--tag",
description: "Optional. The container image tag",
args: { name: "tag" },
},
helpOption,
],
},
{
name: "deploy",
description: "Deploys a job to an environment",
options: [
appOptionGenerated,
envNameOptionGenerated,
{
name: ["--name", "-n"],
description: "Name of the job",
args: { name: "name" },
},
{
name: "--resource-tags",
description:
"Optional. Labels with a key and value separated by commas. Allows you to categorize resources",
args: { name: "resource-tags" },
},
{
name: "--tag",
description: "Optional. The container image tag",
args: { name: "tag" },
},
helpOption,
],
},
{
name: "delete",
description: "Deletes a job from an application",
options: [
appOptionGenerated,
envNameOptionGenerated,
{
name: ["--name", "-n"],
description: "Name of the job",
args: { name: "name" },
},
yesOption,
helpOption,
],
},
],
options: [helpOption],
},
{
name: "task",
description:
"Commands for tasks. One-off Amazon ECS tasks that terminate once their work is done",
subcommands: [
{
name: "run",
description: "Run a one-off task on Amazon ECS",
options: [
{
name: "--app",
description: "Optional. Name of the application",
args: { name: "app", generators: applicationName },
exclusiveOn: ["--default", "--subnets", "--security-groups"],
},
{
name: "--build-context",
description: "Path to the Docker build context",
args: { name: "build-context" },
exclusiveOn: ["--image", "-i"],
},
{
name: "--cluster",
description:
"Optional. The short name or full ARN of the cluster to run the task in",
args: { name: "cluster" },
exclusiveOn: ["--app", "--env", "--default"],
},
{
name: "--command",
description:
'Optional. The command that is passed to "docker run" to override the default command',
args: { name: "command" },
},
{
name: "--count",
description: "Optional. The number of tasks to set up",
args: { name: "count", default: "1" },
},
{
name: "--cpu",
description:
"Optional. The number of CPU units to reserve for each task",
args: { name: "cpu", default: "256" },
},
{
name: "--default",
description:
"Optional. Run tasks in default cluster and default subnets",
exclusiveOn: ["--app", "--env", "--subnets"],
},
{
name: "--dockerfile",
description: "Path to the Dockerfile",
args: { name: "dockerfile", default: "Dockerfile" },
exclusiveOn: ["--image", "-i"],
},
{
name: "--entrypoint",
description:
'Optional. The entrypoint that is passed to "docker run" to override the default entrypoint',
args: { name: "entrypoint" },
},
{
name: "--env",
description: "Optional. Name of the environment",
args: { name: "env" },
exclusiveOn: ["--default", "--subnets", "--security-groups"],
},
{
name: "--env-vars",
description:
"Optional. Environment variables specified by key=value separated by commas",
args: { name: "env-vars" },
},
{
name: "--execution-role",
description:
"Optional. The ARN of the role that grants the container agent permission to make AWS API calls",
args: { name: "execution-role" },
},
{
name: "--follow",
description: "Optional. Specifies if the logs should be streamed",
},
{
name: "--generate-cmd",
description:
"Optional. Generate a command with a pre-filled value for each flag. To use it for an ECS service, specify --generate-cmd <cluster name>/<service name>. Alternatively, if the service or job is created with Copilot, specify --generate-cmd <application>/<environment>/<service or job name>. Cannot be specified with any other flags",
args: { name: "generate-cmd" },
},
{
name: ["--image", "-i"],
description: "The location of an existing Docker image",
args: { name: "image" },
exclusiveOn: ["--dockerfile", "-d"],
},
{
name: "--memory",
description:
"Optional. The amount of memory to reserve in MiB for each task",
args: { name: "memory", default: "512" },
},
{
name: "--platform-arch",
description:
"Optional. Architecture of the task. Must be specified along with 'platform-os'",
args: { name: "platform-arch" },
},
{
name: "--platform-os",
description:
"Optional. Operating system of the task. Must be specified along with 'platform-arch'",
args: { name: "platform-os" },
},
{
name: "--resource-tags",
description:
"Optional. Labels with a key and value separated by commas. Allows you to categorize resources",
args: { name: "resource-tags" },
},
{
name: "--secrets",
description:
"Optional. Secrets to inject into the container. Specified by key=value separated by commas",
args: { name: "secrets" },
},
{
name: "--security-groups",
description:
"Optional. The security group IDs for the task to use. Can be specified multiple times",
args: { name: "security-groups" },
exclusiveOn: ["--app", "--env"],
},
{
name: "--subnets",
description:
"Optional. The subnet IDs for the task to use. Can be specified multiple times",
args: { name: "subnets" },
exclusiveOn: ["--app", "--env", "--default"],
},
{
name: "--tag",
description:
'Optional. The container image tag in addition to "latest"',
args: { name: "tag" },
},
{
name: ["--task-group-name", "-n"],
description:
"Optional. The group name of the task. Tasks with the same group name share the same set of resources. (default directory name)",
args: { name: "task-group-name" },
},
{
name: "--task-role",
description: "Optional. The ARN of the role for the task to use",
args: { name: "task-role" },
},
helpOption,
],
},
{
name: "exec",
description:
"Execute a command in a running container part of a task",
options: [
appOptionGenerated,
{
name: ["--command", "-c"],
description:
"Optional. The command that is passed to a running container",
args: { name: "command", default: "/bin/sh" },
},
{
name: "--default",
description:
"Optional. Execute commands in running tasks in default cluster and default subnets",
exclusiveOn: ["--app", "--env"],
},
envNameOptionGenerated,
{
name: ["--name", "-n"],
description: "Name of the service, job, or task group",
args: { name: "name" },
},
{
name: "--task-id",
description: "Optional. ID of the task you want to exec in",
args: { name: "task-id" },
},
{
name: "--yes",
description:
"Optional. Whether to update the Session Manager Plugin",
},
helpOption,
],
},
{
name: "delete",
description:
"Deletes a one-off task from an application or default cluster",
options: [
appOptionGenerated,
{
name: "--default",
description:
"Optional. Delete a task which was launched in the default cluster and subnets",
exclusiveOn: ["--app", "--env"],
},
envNameOptionGenerated,
svcNameOptionGenerated,
yesOption,
helpOption,
],
},
],
options: [helpOption],
},
{
name: "storage",
description: "Commands for working with storage and databases",
subcommands: [
{
name: "init",
description:
"Creates a new AWS CloudFormation template for a storage resource",
options: [
{
name: "--engine",
description:
'The database engine used in the cluster. Must be either "MySQL" or "PostgreSQL"',
args: { name: "engine" },
},
{
name: "--initial-db",
description: "The initial database to create in the cluster",
args: { name: "initial-db" },
},
{
name: "--lsi",
description:
"Optional. Attribute to use as an alternate sort key. May be specified up to 5 times. Must be of the format '<keyName>:<dataType>'",
isRepeatable: true,
args: { name: "lsi" },
},
{
name: ["--name", "-n"],
description: "Name of the storage resource to create",