awscli 1.38.15__py3-none-any.whl → 1.38.16__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of awscli might be problematic. Click here for more details.
- awscli/__init__.py +1 -1
- awscli/examples/ecs/create-service.rst +149 -12
- awscli/examples/ecs/run-task.rst +127 -2
- awscli/examples/ecs/start-task.rst +128 -8
- awscli/examples/ecs/update-service.rst +517 -7
- awscli/examples/servicediscovery/create-http-namespace.rst +17 -0
- awscli/examples/servicediscovery/create-public-dns-namespace.rst +18 -0
- awscli/examples/servicediscovery/delete-service-attributes.rst +11 -0
- awscli/examples/servicediscovery/discover-instances-revision.rst +15 -0
- awscli/examples/servicediscovery/discover-instances.rst +1 -0
- awscli/examples/servicediscovery/get-instance.rst +24 -0
- awscli/examples/servicediscovery/get-instances-health-status.rst +17 -0
- awscli/examples/servicediscovery/get-namespace.rst +28 -0
- awscli/examples/servicediscovery/get-operation.rst +2 -1
- awscli/examples/servicediscovery/get-service-attributes.rst +19 -0
- awscli/examples/servicediscovery/get-service.rst +23 -0
- awscli/examples/servicediscovery/list-operations.rst +29 -0
- awscli/examples/servicediscovery/list-tags-for-resource.rst +23 -0
- awscli/examples/servicediscovery/tag-resource.rst +11 -0
- awscli/examples/servicediscovery/untag-resource.rst +11 -0
- awscli/examples/servicediscovery/update-http-namespace.rst +18 -0
- awscli/examples/servicediscovery/update-instance-custom-health-status.rst +12 -0
- awscli/examples/servicediscovery/update-private-dns-namespace.rst +18 -0
- awscli/examples/servicediscovery/update-public-dns-namespace.rst +18 -0
- awscli/examples/servicediscovery/update-service-attributes.rst +11 -0
- awscli/examples/servicediscovery/update-service.rst +17 -0
- {awscli-1.38.15.dist-info → awscli-1.38.16.dist-info}/METADATA +2 -2
- {awscli-1.38.15.dist-info → awscli-1.38.16.dist-info}/RECORD +36 -17
- {awscli-1.38.15.data → awscli-1.38.16.data}/scripts/aws +0 -0
- {awscli-1.38.15.data → awscli-1.38.16.data}/scripts/aws.cmd +0 -0
- {awscli-1.38.15.data → awscli-1.38.16.data}/scripts/aws_bash_completer +0 -0
- {awscli-1.38.15.data → awscli-1.38.16.data}/scripts/aws_completer +0 -0
- {awscli-1.38.15.data → awscli-1.38.16.data}/scripts/aws_zsh_completer.sh +0 -0
- {awscli-1.38.15.dist-info → awscli-1.38.16.dist-info}/LICENSE.txt +0 -0
- {awscli-1.38.15.dist-info → awscli-1.38.16.dist-info}/WHEEL +0 -0
- {awscli-1.38.15.dist-info → awscli-1.38.16.dist-info}/top_level.txt +0 -0
awscli/__init__.py
CHANGED
|
@@ -9,7 +9,7 @@ The following ``create-service`` example shows how to create a service using a F
|
|
|
9
9
|
--desired-count 2 \
|
|
10
10
|
--launch-type FARGATE \
|
|
11
11
|
--platform-version LATEST \
|
|
12
|
-
--network-configuration
|
|
12
|
+
--network-configuration 'awsvpcConfiguration={subnets=[subnet-12344321],securityGroups=[sg-12344321],assignPublicIp=ENABLED}' \
|
|
13
13
|
--tags key=key1,value=value1 key=key2,value=value2 key=key3,value=value3
|
|
14
14
|
|
|
15
15
|
Output::
|
|
@@ -93,6 +93,8 @@ Output::
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
+
For more information, see `Creating a Service <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/create-service-console-v2.html>`__ in the *Amazon ECS Developer Guide*.
|
|
97
|
+
|
|
96
98
|
**Example 2: To create a service using the EC2 launch type**
|
|
97
99
|
|
|
98
100
|
The following ``create-service`` example shows how to create a service called ``ecs-simple-service`` with a task that uses the EC2 launch type. The service uses the ``sleep360`` task definition and it maintains 1 instantiation of the task. ::
|
|
@@ -145,6 +147,8 @@ Output::
|
|
|
145
147
|
}
|
|
146
148
|
}
|
|
147
149
|
|
|
150
|
+
For more information, see `Creating a Service <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/create-service-console-v2.html>`__ in the *Amazon ECS Developer Guide*.
|
|
151
|
+
|
|
148
152
|
**Example 3: To create a service that uses an external deployment controller**
|
|
149
153
|
|
|
150
154
|
The following ``create-service`` example creates a service that uses an external deployment controller. ::
|
|
@@ -189,11 +193,20 @@ Output::
|
|
|
189
193
|
}
|
|
190
194
|
}
|
|
191
195
|
|
|
196
|
+
For more information, see `Creating a Service <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/create-service-console-v2.html>`__ in the *Amazon ECS Developer Guide*.
|
|
197
|
+
|
|
192
198
|
**Example 4: To create a new service behind a load balancer**
|
|
193
199
|
|
|
194
|
-
The following ``create-service`` example shows how to create a service that is behind a load balancer. You must have a load balancer configured in the same Region as your container instance. This example uses the ``--cli-input-json`` option and a JSON input file called ``ecs-simple-service-elb.json`` with the following content::
|
|
200
|
+
The following ``create-service`` example shows how to create a service that is behind a load balancer. You must have a load balancer configured in the same Region as your container instance. This example uses the ``--cli-input-json`` option and a JSON input file called ``ecs-simple-service-elb.json`` with the following content. ::
|
|
195
201
|
|
|
196
|
-
|
|
202
|
+
aws ecs create-service \
|
|
203
|
+
--cluster MyCluster \
|
|
204
|
+
--service-name ecs-simple-service-elb \
|
|
205
|
+
--cli-input-json file://ecs-simple-service-elb.json
|
|
206
|
+
|
|
207
|
+
Contents of ``ecs-simple-service-elb.json``::
|
|
208
|
+
|
|
209
|
+
{
|
|
197
210
|
"serviceName": "ecs-simple-service-elb",
|
|
198
211
|
"taskDefinition": "ecs-demo",
|
|
199
212
|
"loadBalancers": [
|
|
@@ -207,13 +220,6 @@ The following ``create-service`` example shows how to create a service that is b
|
|
|
207
220
|
"role": "ecsServiceRole"
|
|
208
221
|
}
|
|
209
222
|
|
|
210
|
-
Command::
|
|
211
|
-
|
|
212
|
-
aws ecs create-service \
|
|
213
|
-
--cluster MyCluster \
|
|
214
|
-
--service-name ecs-simple-service-elb \
|
|
215
|
-
--cli-input-json file://ecs-simple-service-elb.json
|
|
216
|
-
|
|
217
223
|
Output::
|
|
218
224
|
|
|
219
225
|
{
|
|
@@ -231,7 +237,7 @@ Output::
|
|
|
231
237
|
"roleArn": "arn:aws:iam::123456789012:role/ecsServiceRole",
|
|
232
238
|
"desiredCount": 10,
|
|
233
239
|
"serviceName": "ecs-simple-service-elb",
|
|
234
|
-
"clusterArn": "arn:aws:ecs
|
|
240
|
+
"clusterArn": "arn:aws:ecs:us-west-2:123456789012:cluster/MyCluster",
|
|
235
241
|
"serviceArn": "arn:aws:ecs:us-west-2:123456789012:service/ecs-simple-service-elb",
|
|
236
242
|
"deployments": [
|
|
237
243
|
{
|
|
@@ -250,4 +256,135 @@ Output::
|
|
|
250
256
|
}
|
|
251
257
|
}
|
|
252
258
|
|
|
253
|
-
For more information, see `
|
|
259
|
+
For more information, see `Use load balancing to distribute Amazon ECS service traffic <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-load-balancing.html>`__ in the *Amazon ECS Developer Guide*.
|
|
260
|
+
|
|
261
|
+
**Example 5: To configure Amazon EBS volumes at service creation**
|
|
262
|
+
|
|
263
|
+
The following ``create-service`` example shows how to configure Amazon EBS volumes for each task managed by the service. You must have an Amazon ECS infrastructure role configured with the ``AmazonECSInfrastructureRolePolicyForVolumes`` managed policy attached. You must specify a task definition with the same volume name as in the ``create-service`` request. This example uses the ``--cli-input-json`` option and a JSON input file called ``ecs-simple-service-ebs.json`` with the following content. ::
|
|
264
|
+
|
|
265
|
+
aws ecs create-service \
|
|
266
|
+
--cli-input-json file://ecs-simple-service-ebs.json
|
|
267
|
+
|
|
268
|
+
Contents of ``ecs-simple-service-ebs.json``::
|
|
269
|
+
|
|
270
|
+
{
|
|
271
|
+
"cluster": "mycluster",
|
|
272
|
+
"taskDefinition": "mytaskdef",
|
|
273
|
+
"serviceName": "ecs-simple-service-ebs",
|
|
274
|
+
"desiredCount": 2,
|
|
275
|
+
"launchType": "FARGATE",
|
|
276
|
+
"networkConfiguration":{
|
|
277
|
+
"awsvpcConfiguration":{
|
|
278
|
+
"assignPublicIp": "ENABLED",
|
|
279
|
+
"securityGroups": ["sg-12344321"],
|
|
280
|
+
"subnets":["subnet-12344321"]
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
"volumeConfigurations": [
|
|
284
|
+
{
|
|
285
|
+
"name": "myEbsVolume",
|
|
286
|
+
"managedEBSVolume": {
|
|
287
|
+
"roleArn":"arn:aws:iam::123456789012:role/ecsInfrastructureRole",
|
|
288
|
+
"volumeType": "gp3",
|
|
289
|
+
"sizeInGiB": 100,
|
|
290
|
+
"iops": 3000,
|
|
291
|
+
"throughput": 125,
|
|
292
|
+
"filesystemType": "ext4"
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
]
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
Output::
|
|
299
|
+
|
|
300
|
+
{
|
|
301
|
+
"service": {
|
|
302
|
+
"serviceArn": "arn:aws:ecs:us-west-2:123456789012:service/mycluster/ecs-simple-service-ebs",
|
|
303
|
+
"serviceName": "ecs-simple-service-ebs",
|
|
304
|
+
"clusterArn": "arn:aws:ecs:us-west-2:123456789012:cluster/mycluster",
|
|
305
|
+
"loadBalancers": [],
|
|
306
|
+
"serviceRegistries": [],
|
|
307
|
+
"status": "ACTIVE",
|
|
308
|
+
"desiredCount": 2,
|
|
309
|
+
"runningCount": 0,
|
|
310
|
+
"pendingCount": 0,
|
|
311
|
+
"launchType": "EC2",
|
|
312
|
+
"taskDefinition": "arn:aws:ecs:us-west-2:123456789012:task-definition/mytaskdef:3",
|
|
313
|
+
"deploymentConfiguration": {
|
|
314
|
+
"deploymentCircuitBreaker": {
|
|
315
|
+
"enable": false,
|
|
316
|
+
"rollback": false
|
|
317
|
+
},
|
|
318
|
+
"maximumPercent": 200,
|
|
319
|
+
"minimumHealthyPercent": 100
|
|
320
|
+
},
|
|
321
|
+
"deployments": [
|
|
322
|
+
{
|
|
323
|
+
"id": "ecs-svc/7851020056849183687",
|
|
324
|
+
"status": "PRIMARY",
|
|
325
|
+
"taskDefinition": "arn:aws:ecs:us-west-2:123456789012:task-definition/mytaskdef:3",
|
|
326
|
+
"desiredCount": 0,
|
|
327
|
+
"pendingCount": 0,
|
|
328
|
+
"runningCount": 0,
|
|
329
|
+
"failedTasks": 0,
|
|
330
|
+
"createdAt": "2025-01-21T11:32:38.034000-06:00",
|
|
331
|
+
"updatedAt": "2025-01-21T11:32:38.034000-06:00",
|
|
332
|
+
"launchType": "EC2",
|
|
333
|
+
"networkConfiguration": {
|
|
334
|
+
"awsvpcConfiguration": {
|
|
335
|
+
"subnets": [
|
|
336
|
+
"subnet-12344321"
|
|
337
|
+
],
|
|
338
|
+
"securityGroups": [
|
|
339
|
+
"sg-12344321"
|
|
340
|
+
],
|
|
341
|
+
"assignPublicIp": "DISABLED"
|
|
342
|
+
}
|
|
343
|
+
},
|
|
344
|
+
"rolloutState": "IN_PROGRESS",
|
|
345
|
+
"rolloutStateReason": "ECS deployment ecs-svc/7851020056849183687 in progress.",
|
|
346
|
+
"volumeConfigurations": [
|
|
347
|
+
{
|
|
348
|
+
"name": "myEBSVolume",
|
|
349
|
+
"managedEBSVolume": {
|
|
350
|
+
"volumeType": "gp3",
|
|
351
|
+
"sizeInGiB": 100,
|
|
352
|
+
"iops": 3000,
|
|
353
|
+
"throughput": 125,
|
|
354
|
+
"roleArn": "arn:aws:iam::123456789012:role/ecsInfrastructureRole",
|
|
355
|
+
"filesystemType": "ext4"
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
]
|
|
359
|
+
}
|
|
360
|
+
],
|
|
361
|
+
"roleArn": "arn:aws:iam::123456789012:role/aws-service-role/ecs.amazonaws.com/AWSServiceRoleForECS",
|
|
362
|
+
"events": [],
|
|
363
|
+
"createdAt": "2025-01-21T11:32:38.034000-06:00",
|
|
364
|
+
"placementConstraints": [],
|
|
365
|
+
"placementStrategy": [],
|
|
366
|
+
"networkConfiguration": {
|
|
367
|
+
"awsvpcConfiguration": {
|
|
368
|
+
"subnets": [
|
|
369
|
+
"subnet-12344321"
|
|
370
|
+
],
|
|
371
|
+
"securityGroups": [
|
|
372
|
+
"sg-12344321"
|
|
373
|
+
],
|
|
374
|
+
"assignPublicIp": "DISABLED"
|
|
375
|
+
}
|
|
376
|
+
},
|
|
377
|
+
"healthCheckGracePeriodSeconds": 0,
|
|
378
|
+
"schedulingStrategy": "REPLICA",
|
|
379
|
+
"deploymentController": {
|
|
380
|
+
"type": "ECS"
|
|
381
|
+
},
|
|
382
|
+
"createdBy": "arn:aws:iam::123456789012:user/AIDACKCEVSQ6C2EXAMPLE",
|
|
383
|
+
"enableECSManagedTags": false,
|
|
384
|
+
"propagateTags": "NONE",
|
|
385
|
+
"enableExecuteCommand": false,
|
|
386
|
+
"availabilityZoneRebalancing": "DISABLED"
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
For more information, see `Use Amazon EBS volumes with Amazon ECS <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ebs-volumes.html>`__ in the *Amazon ECS Developer Guide*.
|
awscli/examples/ecs/run-task.rst
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
**To run a task on your default cluster**
|
|
1
|
+
**Example 1: To run a task on your default cluster**
|
|
2
2
|
|
|
3
3
|
The following ``run-task`` example runs a task on the default cluster and uses a client token. ::
|
|
4
4
|
|
|
@@ -60,4 +60,129 @@ Output::
|
|
|
60
60
|
"failures": []
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
For more information, see `Running
|
|
63
|
+
For more information, see `Running an application as a standalone task <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/standalone-task-create.html>`__ in the *Amazon ECS Developer Guide*.
|
|
64
|
+
|
|
65
|
+
**Example 2: To configure an Amazon EBS volume for a standalone task**
|
|
66
|
+
|
|
67
|
+
The following ``run-task`` example configures an encrypted Amazon EBS volume for a Fargate task on the default cluster. You must have an Amazon ECS infrastructure role configured with the ``AmazonECSInfrastructureRolePolicyForVolumes`` managed policy attached. You must specify a task definition with the same volume name as in the ``run-task`` request. This example uses the ``--cli-input-json`` option and a JSON input file called ``ebs.json``. ::
|
|
68
|
+
|
|
69
|
+
aws ecs run-task \
|
|
70
|
+
--cli-input-json file://ebs.json
|
|
71
|
+
|
|
72
|
+
Contents of ``ebs.json``::
|
|
73
|
+
|
|
74
|
+
{
|
|
75
|
+
"cluster": "default",
|
|
76
|
+
"taskDefinition": "mytaskdef",
|
|
77
|
+
"launchType": "FARGATE",
|
|
78
|
+
"networkConfiguration":{
|
|
79
|
+
"awsvpcConfiguration":{
|
|
80
|
+
"assignPublicIp": "ENABLED",
|
|
81
|
+
"securityGroups": ["sg-12344321"],
|
|
82
|
+
"subnets":["subnet-12344321"]
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"volumeConfigurations": [
|
|
86
|
+
{
|
|
87
|
+
"name": "myEBSVolume",
|
|
88
|
+
"managedEBSVolume": {
|
|
89
|
+
"volumeType": "gp3",
|
|
90
|
+
"sizeInGiB": 100,
|
|
91
|
+
"roleArn":"arn:aws:iam::1111222333:role/ecsInfrastructureRole",
|
|
92
|
+
"encrypted": true,
|
|
93
|
+
"kmsKeyId": "arn:aws:kms:region:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
Output::
|
|
100
|
+
|
|
101
|
+
{
|
|
102
|
+
"tasks": [
|
|
103
|
+
{
|
|
104
|
+
"attachments": [
|
|
105
|
+
{
|
|
106
|
+
"id": "ce868693-15ca-4083-91ac-f782f64000c9",
|
|
107
|
+
"type": "ElasticNetworkInterface",
|
|
108
|
+
"status": "PRECREATED",
|
|
109
|
+
"details": [
|
|
110
|
+
{
|
|
111
|
+
"name": "subnetId",
|
|
112
|
+
"value": "subnet-070982705451dad82"
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"id": "a17ed863-786c-4372-b5b3-b23e53f37877",
|
|
118
|
+
"type": "AmazonElasticBlockStorage",
|
|
119
|
+
"status": "CREATED",
|
|
120
|
+
"details": [
|
|
121
|
+
{
|
|
122
|
+
"name": "roleArn",
|
|
123
|
+
"value": "arn:aws:iam::123456789012:role/ecsInfrastructureRole"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"name": "volumeName",
|
|
127
|
+
"value": "myEBSVolume"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"name": "deleteOnTermination",
|
|
131
|
+
"value": "true"
|
|
132
|
+
}
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
],
|
|
136
|
+
"attributes": [
|
|
137
|
+
{
|
|
138
|
+
"name": "ecs.cpu-architecture",
|
|
139
|
+
"value": "x86_64"
|
|
140
|
+
}
|
|
141
|
+
],
|
|
142
|
+
"availabilityZone": "us-west-2b",
|
|
143
|
+
"clusterArn": "arn:aws:ecs:us-west-2:123456789012:cluster/default",
|
|
144
|
+
"containers": [
|
|
145
|
+
{
|
|
146
|
+
"containerArn": "arn:aws:ecs:us-west-2:123456789012:container/default/7f1fbd3629434cc4b82d72d2f09b67c9/e21962a2-f328-4699-98a3-5161ac2c186a",
|
|
147
|
+
"taskArn": "arn:aws:ecs:us-west-2:123456789012:task/default/7f1fbd3629434cc4b82d72d2f09b67c9",
|
|
148
|
+
"name": "container-using-ebs",
|
|
149
|
+
"image": "amazonlinux:2",
|
|
150
|
+
"lastStatus": "PENDING",
|
|
151
|
+
"networkInterfaces": [],
|
|
152
|
+
"cpu": "0"
|
|
153
|
+
}
|
|
154
|
+
],
|
|
155
|
+
"cpu": "1024",
|
|
156
|
+
"createdAt": "2025-01-23T10:29:46.650000-06:00",
|
|
157
|
+
"desiredStatus": "RUNNING",
|
|
158
|
+
"enableExecuteCommand": false,
|
|
159
|
+
"group": "family:mytaskdef",
|
|
160
|
+
"lastStatus": "PROVISIONING",
|
|
161
|
+
"launchType": "FARGATE",
|
|
162
|
+
"memory": "3072",
|
|
163
|
+
"overrides": {
|
|
164
|
+
"containerOverrides": [
|
|
165
|
+
{
|
|
166
|
+
"name": "container-using-ebs"
|
|
167
|
+
}
|
|
168
|
+
],
|
|
169
|
+
"inferenceAcceleratorOverrides": []
|
|
170
|
+
},
|
|
171
|
+
"platformVersion": "1.4.0",
|
|
172
|
+
"platformFamily": "Linux",
|
|
173
|
+
"tags": [],
|
|
174
|
+
"taskArn": "arn:aws:ecs:us-west-2:123456789012:task/default/7f1fbd3629434cc4b82d72d2f09b67c9",
|
|
175
|
+
"taskDefinitionArn": "arn:aws:ecs:us-west-2:123456789012:task-definition/mytaskdef:4",
|
|
176
|
+
"version": 1,
|
|
177
|
+
"ephemeralStorage": {
|
|
178
|
+
"sizeInGiB": 20
|
|
179
|
+
},
|
|
180
|
+
"fargateEphemeralStorage": {
|
|
181
|
+
"sizeInGiB": 20
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
],
|
|
185
|
+
"failures": []
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
For more information, see `Use Amazon EBS volumes with Amazon ECS <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ebs-volumes.html>`__ in the *Amazon ECS Developer Guide*.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
**To start a new task**
|
|
1
|
+
**Example 1: To start a new task**
|
|
2
2
|
|
|
3
|
-
The following ``start-task`` starts a task using the latest revision of the ``sleep360`` task definition on the specified container instance in the default cluster. ::
|
|
3
|
+
The following ``start-task`` example starts a task using the latest revision of the ``sleep360`` task definition on the specified container instance in the default cluster. ::
|
|
4
4
|
|
|
5
5
|
aws ecs start-task \
|
|
6
6
|
--task-definition sleep360 \
|
|
@@ -11,10 +11,10 @@ Output::
|
|
|
11
11
|
{
|
|
12
12
|
"tasks": [
|
|
13
13
|
{
|
|
14
|
-
"taskArn": "arn:aws:ecs:us-west-2:
|
|
15
|
-
"clusterArn": "arn:aws:ecs:us-west-2:
|
|
16
|
-
"taskDefinitionArn": "arn:aws:ecs:us-west-2:
|
|
17
|
-
"containerInstanceArn": "arn:aws:ecs:us-west-2:
|
|
14
|
+
"taskArn": "arn:aws:ecs:us-west-2:123456789012:task/default/666fdccc2e2d4b6894dd422f4eeee8f8",
|
|
15
|
+
"clusterArn": "arn:aws:ecs:us-west-2:123456789012:cluster/default",
|
|
16
|
+
"taskDefinitionArn": "arn:aws:ecs:us-west-2:123456789012:task-definition/sleep360:3",
|
|
17
|
+
"containerInstanceArn": "arn:aws:ecs:us-west-2:123456789012:container-instance/default/765936fadbdd46b5991a4bd70c2a43d4",
|
|
18
18
|
"overrides": {
|
|
19
19
|
"containerOverrides": [
|
|
20
20
|
{
|
|
@@ -28,8 +28,8 @@ Output::
|
|
|
28
28
|
"memory": "128",
|
|
29
29
|
"containers": [
|
|
30
30
|
{
|
|
31
|
-
"containerArn": "arn:aws:ecs:us-west-2:
|
|
32
|
-
"taskArn": "arn:aws:ecs:us-west-2:
|
|
31
|
+
"containerArn": "arn:aws:ecs:us-west-2:123456789012:container/75f11ed4-8a3d-4f26-a33b-ad1db9e02d41",
|
|
32
|
+
"taskArn": "arn:aws:ecs:us-west-2:123456789012:task/default/666fdccc2e2d4b6894dd422f4eeee8f8",
|
|
33
33
|
"name": "sleep",
|
|
34
34
|
"lastStatus": "PENDING",
|
|
35
35
|
"networkInterfaces": [],
|
|
@@ -47,3 +47,123 @@ Output::
|
|
|
47
47
|
],
|
|
48
48
|
"failures": []
|
|
49
49
|
}
|
|
50
|
+
|
|
51
|
+
For more information, see `Schedule your containers on Amazon ECS <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/scheduling_tasks.html>`__ in the *Amazon ECS Developer Guide*.
|
|
52
|
+
|
|
53
|
+
**Example 2: To configure an Amazon EBS volume at task start**
|
|
54
|
+
|
|
55
|
+
The following ``start-task`` example configures an encrypted Amazon EBS volume for a task on the specified container instance. You must have an Amazon ECS infrastructure role configured with the ``AmazonECSInfrastructureRolePolicyForVolumes`` managed policy attached. You must specify a task definition with the same volume name as in the ``start-task`` request. This example uses the ``--cli-input-json`` option and a JSON input file called ``ebs.json`` with the following content. ::
|
|
56
|
+
|
|
57
|
+
aws ecs start-task \
|
|
58
|
+
--cli-input-json file://ebs.json \
|
|
59
|
+
--container-instances 765936fadbdd46b5991a4bd70c2a43d4
|
|
60
|
+
|
|
61
|
+
Contents of ``ebs.json``::
|
|
62
|
+
|
|
63
|
+
{
|
|
64
|
+
"cluster": "default",
|
|
65
|
+
"taskDefinition": "mytaskdef",
|
|
66
|
+
"networkConfiguration":{
|
|
67
|
+
"awsvpcConfiguration":{
|
|
68
|
+
"assignPublicIp": "ENABLED",
|
|
69
|
+
"securityGroups": ["sg-12344321"],
|
|
70
|
+
"subnets":["subnet-12344321"]
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"volumeConfigurations": [
|
|
74
|
+
{
|
|
75
|
+
"name": "myEBSVolume",
|
|
76
|
+
"managedEBSVolume": {
|
|
77
|
+
"volumeType": "gp3",
|
|
78
|
+
"sizeInGiB": 100,
|
|
79
|
+
"roleArn":"arn:aws:iam::123456789012:role/ecsInfrastructureRole",
|
|
80
|
+
"encrypted": true,
|
|
81
|
+
"kmsKeyId": "arn:aws:kms:region:123456789012:key/1234abcd-12ab-34cd-56ef-1234567890ab"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
Output::
|
|
88
|
+
|
|
89
|
+
{
|
|
90
|
+
"tasks": [
|
|
91
|
+
{
|
|
92
|
+
"attachments": [
|
|
93
|
+
{
|
|
94
|
+
"id": "aea29489-9dcd-49f1-8164-4d91566e1113",
|
|
95
|
+
"type": "ElasticNetworkInterface",
|
|
96
|
+
"status": "PRECREATED",
|
|
97
|
+
"details": [
|
|
98
|
+
{
|
|
99
|
+
"name": "subnetId",
|
|
100
|
+
"value": "subnet-12344321"
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"id": "f29e1222-9a1e-410f-b499-a12a7cd6d42e",
|
|
106
|
+
"type": "AmazonElasticBlockStorage",
|
|
107
|
+
"status": "CREATED",
|
|
108
|
+
"details": [
|
|
109
|
+
{
|
|
110
|
+
"name": "roleArn",
|
|
111
|
+
"value": "arn:aws:iam::123456789012:role/ecsInfrastructureRole"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"name": "volumeName",
|
|
115
|
+
"value": "myEBSVolume"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"name": "deleteOnTermination",
|
|
119
|
+
"value": "true"
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
],
|
|
124
|
+
"attributes": [
|
|
125
|
+
{
|
|
126
|
+
"name": "ecs.cpu-architecture",
|
|
127
|
+
"value": "arm64"
|
|
128
|
+
}
|
|
129
|
+
],
|
|
130
|
+
"availabilityZone": "us-west-2c",
|
|
131
|
+
"clusterArn": "arn:aws:ecs:us-west-2:123456789012:cluster/default",
|
|
132
|
+
"containerInstanceArn": "arn:aws:ecs:us-west-2:123456789012:container-instance/default/765936fadbdd46b5991a4bd70c2a43d4",
|
|
133
|
+
"containers": [
|
|
134
|
+
{
|
|
135
|
+
"containerArn": "arn:aws:ecs:us-west-2:123456789012:container/default/bb122ace3ed84add92c00a351a03c69e/a4a9ed10-51c7-4567-9653-50e71b94f867",
|
|
136
|
+
"taskArn": "arn:aws:ecs:us-west-2:123456789012:task/default/bb122ace3ed84add92c00a351a03c69e",
|
|
137
|
+
"name": "container-using-ebs",
|
|
138
|
+
"image": "amazonlinux:2",
|
|
139
|
+
"lastStatus": "PENDING",
|
|
140
|
+
"networkInterfaces": [],
|
|
141
|
+
"cpu": "0"
|
|
142
|
+
}
|
|
143
|
+
],
|
|
144
|
+
"cpu": "1024",
|
|
145
|
+
"createdAt": "2025-01-23T14:51:05.191000-06:00",
|
|
146
|
+
"desiredStatus": "RUNNING",
|
|
147
|
+
"enableExecuteCommand": false,
|
|
148
|
+
"group": "family:mytaskdef",
|
|
149
|
+
"lastStatus": "PROVISIONING",
|
|
150
|
+
"launchType": "EC2",
|
|
151
|
+
"memory": "3072",
|
|
152
|
+
"overrides": {
|
|
153
|
+
"containerOverrides": [
|
|
154
|
+
{
|
|
155
|
+
"name": "container-using-ebs"
|
|
156
|
+
}
|
|
157
|
+
],
|
|
158
|
+
"inferenceAcceleratorOverrides": []
|
|
159
|
+
},
|
|
160
|
+
"tags": [],
|
|
161
|
+
"taskArn": "arn:aws:ecs:us-west-2:123456789012:task/default/bb122ace3ed84add92c00a351a03c69e",
|
|
162
|
+
"taskDefinitionArn": "arn:aws:ecs:us-west-2:123456789012:task-definition/mytaskdef:4",
|
|
163
|
+
"version": 1
|
|
164
|
+
}
|
|
165
|
+
],
|
|
166
|
+
"failures": []
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
For more information, see `Use Amazon EBS volumes with Amazon ECS <https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ebs-volumes.html>`__ in the *Amazon ECS Developer Guide*.
|