Skip to content

Commit fabc6b1

Browse files
author
awstools
committed
feat(client-ecs): This release adds support for ECS Service Connect, a new capability that simplifies writing and operating resilient distributed applications. This release updates the TaskDefinition, Cluster, Service mutation APIs with Service connect constructs and also adds a new ListServicesByNamespace API.
1 parent 94b6569 commit fabc6b1

File tree

13 files changed

+1659
-198
lines changed

13 files changed

+1659
-198
lines changed

clients/client-ecs/src/ECS.ts

Lines changed: 55 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,11 @@ import {
131131
ListContainerInstancesCommandInput,
132132
ListContainerInstancesCommandOutput,
133133
} from "./commands/ListContainerInstancesCommand";
134+
import {
135+
ListServicesByNamespaceCommand,
136+
ListServicesByNamespaceCommandInput,
137+
ListServicesByNamespaceCommandOutput,
138+
} from "./commands/ListServicesByNamespaceCommand";
134139
import {
135140
ListServicesCommand,
136141
ListServicesCommandInput,
@@ -428,9 +433,8 @@ export class ECS extends ECSClient {
428433
* <p>When creating a service that uses the <code>EXTERNAL</code> deployment controller, you
429434
* can specify only parameters that aren't controlled at the task set level. The only
430435
* required parameter is the service name. You control your services using the <a>CreateTaskSet</a> operation. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html">Amazon ECS deployment types</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
431-
* <p>When the service scheduler launches new tasks, it determines task placement. For
432-
* information about task placement and task placement strategies, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement.html">Amazon ECS
433-
* task placement</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
436+
* <p>When the service scheduler launches new tasks, it determines task placement. For information
437+
* about task placement and task placement strategies, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement.html">Amazon ECS task placement</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
434438
*/
435439
public createService(
436440
args: CreateServiceCommandInput,
@@ -1094,7 +1098,7 @@ export class ECS extends ECSClient {
10941098
/**
10951099
* <p>Runs a command remotely on a container within a task.</p>
10961100
* <p>If you use a condition key in your IAM policy to refine the conditions for the policy
1097-
* statement, for example limit the actions to a specific cluster, you recevie an
1101+
* statement, for example limit the actions to a specific cluster, you receive an
10981102
* <code>AccessDeniedException</code> when there is a mismatch between the condition
10991103
* key value and the corresponding parameter value.</p>
11001104
*/
@@ -1323,6 +1327,42 @@ export class ECS extends ECSClient {
13231327
}
13241328
}
13251329

1330+
/**
1331+
* <p>This operation lists all of the services that are associated with a Cloud Map namespace. This list
1332+
* might include services in different clusters. In contrast, <code>ListServices</code> can
1333+
* only list services in one cluster at a time. If you need to filter the list of
1334+
* services in a single cluster by various parameters, use <code>ListServices</code>.
1335+
* For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html">Service Connect</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
1336+
*/
1337+
public listServicesByNamespace(
1338+
args: ListServicesByNamespaceCommandInput,
1339+
options?: __HttpHandlerOptions
1340+
): Promise<ListServicesByNamespaceCommandOutput>;
1341+
public listServicesByNamespace(
1342+
args: ListServicesByNamespaceCommandInput,
1343+
cb: (err: any, data?: ListServicesByNamespaceCommandOutput) => void
1344+
): void;
1345+
public listServicesByNamespace(
1346+
args: ListServicesByNamespaceCommandInput,
1347+
options: __HttpHandlerOptions,
1348+
cb: (err: any, data?: ListServicesByNamespaceCommandOutput) => void
1349+
): void;
1350+
public listServicesByNamespace(
1351+
args: ListServicesByNamespaceCommandInput,
1352+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: ListServicesByNamespaceCommandOutput) => void),
1353+
cb?: (err: any, data?: ListServicesByNamespaceCommandOutput) => void
1354+
): Promise<ListServicesByNamespaceCommandOutput> | void {
1355+
const command = new ListServicesByNamespaceCommand(args);
1356+
if (typeof optionsOrCb === "function") {
1357+
this.send(command, optionsOrCb);
1358+
} else if (typeof cb === "function") {
1359+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
1360+
this.send(command, optionsOrCb || {}, cb);
1361+
} else {
1362+
return this.send(command, optionsOrCb);
1363+
}
1364+
}
1365+
13261366
/**
13271367
* <p>List the tags for an Amazon ECS resource.</p>
13281368
*/
@@ -2109,6 +2149,11 @@ export class ECS extends ECSClient {
21092149
* Amazon ECS container agent</a> in the
21102150
* <i>Amazon Elastic Container Service Developer Guide</i>.</p>
21112151
* </note>
2152+
* <note>
2153+
* <p>Agent updates with the <code>UpdateContainerAgent</code> API operation do not
2154+
* apply to Windows container instances. We recommend that you launch new container
2155+
* instances to update the agent version in your Windows clusters.</p>
2156+
* </note>
21122157
* <p>The <code>UpdateContainerAgent</code> API requires an Amazon ECS-optimized AMI or Amazon
21132158
* Linux AMI with the <code>ecs-init</code> service installed and running. For help
21142159
* updating the Amazon ECS container agent on other operating systems, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-update.html#manually_update_agent">Manually updating the Amazon ECS container agent</a> in the
@@ -2430,17 +2475,18 @@ export class ECS extends ECSClient {
24302475
* <code>protectionEnabled</code> set to <code>true</code>. You can keep extending the
24312476
* protection expiration period of a task by invoking this operation repeatedly.</p>
24322477
* <p>To learn more about Amazon ECS task protection, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-scale-in-protection.html">Task scale-in
2433-
* protection</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
2478+
* protection</a> in the <i>
2479+
* <i>Amazon Elastic Container Service Developer Guide</i>
2480+
* </i>.</p>
24342481
* <note>
24352482
* <p>This operation is only supported for tasks belonging to an Amazon ECS service. Invoking
24362483
* this operation for a standalone task will result in an <code>TASK_NOT_VALID</code>
2437-
* failure. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/api_failures_messages.html.html">API
2438-
* failure reasons</a>.</p>
2484+
* failure. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/api_failures_messages.html">API failure
2485+
* reasons</a>.</p>
24392486
* </note>
24402487
* <important>
24412488
* <p>If you prefer to set task protection from within the container, we recommend using
2442-
* the <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-endpoint.html">Amazon ECS container
2443-
* agent endpoint</a>.</p>
2489+
* the <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-scale-in-protection-endpoint.html">Task scale-in protection endpoint</a>.</p>
24442490
* </important>
24452491
*/
24462492
public updateTaskProtection(

clients/client-ecs/src/ECSClient.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ import {
106106
ListContainerInstancesCommandInput,
107107
ListContainerInstancesCommandOutput,
108108
} from "./commands/ListContainerInstancesCommand";
109+
import {
110+
ListServicesByNamespaceCommandInput,
111+
ListServicesByNamespaceCommandOutput,
112+
} from "./commands/ListServicesByNamespaceCommand";
109113
import { ListServicesCommandInput, ListServicesCommandOutput } from "./commands/ListServicesCommand";
110114
import {
111115
ListTagsForResourceCommandInput,
@@ -217,6 +221,7 @@ export type ServiceInputTypes =
217221
| ListAttributesCommandInput
218222
| ListClustersCommandInput
219223
| ListContainerInstancesCommandInput
224+
| ListServicesByNamespaceCommandInput
220225
| ListServicesCommandInput
221226
| ListTagsForResourceCommandInput
222227
| ListTaskDefinitionFamiliesCommandInput
@@ -273,6 +278,7 @@ export type ServiceOutputTypes =
273278
| ListAttributesCommandOutput
274279
| ListClustersCommandOutput
275280
| ListContainerInstancesCommandOutput
281+
| ListServicesByNamespaceCommandOutput
276282
| ListServicesCommandOutput
277283
| ListTagsForResourceCommandOutput
278284
| ListTaskDefinitionFamiliesCommandOutput

clients/client-ecs/src/commands/CreateServiceCommand.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,8 @@ export interface CreateServiceCommandOutput extends CreateServiceResponse, __Met
106106
* <p>When creating a service that uses the <code>EXTERNAL</code> deployment controller, you
107107
* can specify only parameters that aren't controlled at the task set level. The only
108108
* required parameter is the service name. You control your services using the <a>CreateTaskSet</a> operation. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html">Amazon ECS deployment types</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
109-
* <p>When the service scheduler launches new tasks, it determines task placement. For
110-
* information about task placement and task placement strategies, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement.html">Amazon ECS
111-
* task placement</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
109+
* <p>When the service scheduler launches new tasks, it determines task placement. For information
110+
* about task placement and task placement strategies, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement.html">Amazon ECS task placement</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
112111
* @example
113112
* Use a bare-bones client and the command you need to make an API call.
114113
* ```javascript

clients/client-ecs/src/commands/ExecuteCommandCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export interface ExecuteCommandCommandOutput extends ExecuteCommandResponse, __M
3131
/**
3232
* <p>Runs a command remotely on a container within a task.</p>
3333
* <p>If you use a condition key in your IAM policy to refine the conditions for the policy
34-
* statement, for example limit the actions to a specific cluster, you recevie an
34+
* statement, for example limit the actions to a specific cluster, you receive an
3535
* <code>AccessDeniedException</code> when there is a mismatch between the condition
3636
* key value and the corresponding parameter value.</p>
3737
* @example
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
// smithy-typescript generated code
2+
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
3+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
4+
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
5+
import { Command as $Command } from "@aws-sdk/smithy-client";
6+
import {
7+
FinalizeHandlerArguments,
8+
Handler,
9+
HandlerExecutionContext,
10+
HttpHandlerOptions as __HttpHandlerOptions,
11+
MetadataBearer as __MetadataBearer,
12+
MiddlewareStack,
13+
SerdeContext as __SerdeContext,
14+
} from "@aws-sdk/types";
15+
16+
import { ECSClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ECSClient";
17+
import {
18+
ListServicesByNamespaceRequest,
19+
ListServicesByNamespaceRequestFilterSensitiveLog,
20+
ListServicesByNamespaceResponse,
21+
ListServicesByNamespaceResponseFilterSensitiveLog,
22+
} from "../models/models_0";
23+
import {
24+
deserializeAws_json1_1ListServicesByNamespaceCommand,
25+
serializeAws_json1_1ListServicesByNamespaceCommand,
26+
} from "../protocols/Aws_json1_1";
27+
28+
export interface ListServicesByNamespaceCommandInput extends ListServicesByNamespaceRequest {}
29+
export interface ListServicesByNamespaceCommandOutput extends ListServicesByNamespaceResponse, __MetadataBearer {}
30+
31+
/**
32+
* <p>This operation lists all of the services that are associated with a Cloud Map namespace. This list
33+
* might include services in different clusters. In contrast, <code>ListServices</code> can
34+
* only list services in one cluster at a time. If you need to filter the list of
35+
* services in a single cluster by various parameters, use <code>ListServices</code>.
36+
* For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html">Service Connect</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
37+
* @example
38+
* Use a bare-bones client and the command you need to make an API call.
39+
* ```javascript
40+
* import { ECSClient, ListServicesByNamespaceCommand } from "@aws-sdk/client-ecs"; // ES Modules import
41+
* // const { ECSClient, ListServicesByNamespaceCommand } = require("@aws-sdk/client-ecs"); // CommonJS import
42+
* const client = new ECSClient(config);
43+
* const command = new ListServicesByNamespaceCommand(input);
44+
* const response = await client.send(command);
45+
* ```
46+
*
47+
* @see {@link ListServicesByNamespaceCommandInput} for command's `input` shape.
48+
* @see {@link ListServicesByNamespaceCommandOutput} for command's `response` shape.
49+
* @see {@link ECSClientResolvedConfig | config} for ECSClient's `config` shape.
50+
*
51+
*/
52+
export class ListServicesByNamespaceCommand extends $Command<
53+
ListServicesByNamespaceCommandInput,
54+
ListServicesByNamespaceCommandOutput,
55+
ECSClientResolvedConfig
56+
> {
57+
// Start section: command_properties
58+
// End section: command_properties
59+
60+
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
61+
return {
62+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
63+
Endpoint: { type: "builtInParams", name: "endpoint" },
64+
Region: { type: "builtInParams", name: "region" },
65+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
66+
};
67+
}
68+
69+
constructor(readonly input: ListServicesByNamespaceCommandInput) {
70+
// Start section: command_constructor
71+
super();
72+
// End section: command_constructor
73+
}
74+
75+
/**
76+
* @internal
77+
*/
78+
resolveMiddleware(
79+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
80+
configuration: ECSClientResolvedConfig,
81+
options?: __HttpHandlerOptions
82+
): Handler<ListServicesByNamespaceCommandInput, ListServicesByNamespaceCommandOutput> {
83+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
84+
this.middlewareStack.use(
85+
getEndpointPlugin(configuration, ListServicesByNamespaceCommand.getEndpointParameterInstructions())
86+
);
87+
88+
const stack = clientStack.concat(this.middlewareStack);
89+
90+
const { logger } = configuration;
91+
const clientName = "ECSClient";
92+
const commandName = "ListServicesByNamespaceCommand";
93+
const handlerExecutionContext: HandlerExecutionContext = {
94+
logger,
95+
clientName,
96+
commandName,
97+
inputFilterSensitiveLog: ListServicesByNamespaceRequestFilterSensitiveLog,
98+
outputFilterSensitiveLog: ListServicesByNamespaceResponseFilterSensitiveLog,
99+
};
100+
const { requestHandler } = configuration;
101+
return stack.resolve(
102+
(request: FinalizeHandlerArguments<any>) =>
103+
requestHandler.handle(request.request as __HttpRequest, options || {}),
104+
handlerExecutionContext
105+
);
106+
}
107+
108+
private serialize(input: ListServicesByNamespaceCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
109+
return serializeAws_json1_1ListServicesByNamespaceCommand(input, context);
110+
}
111+
112+
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<ListServicesByNamespaceCommandOutput> {
113+
return deserializeAws_json1_1ListServicesByNamespaceCommand(output, context);
114+
}
115+
116+
// Start section: command_body_extra
117+
// End section: command_body_extra
118+
}

clients/client-ecs/src/commands/UpdateContainerAgentCommand.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ export interface UpdateContainerAgentCommandOutput extends UpdateContainerAgentR
4141
* Amazon ECS container agent</a> in the
4242
* <i>Amazon Elastic Container Service Developer Guide</i>.</p>
4343
* </note>
44+
* <note>
45+
* <p>Agent updates with the <code>UpdateContainerAgent</code> API operation do not
46+
* apply to Windows container instances. We recommend that you launch new container
47+
* instances to update the agent version in your Windows clusters.</p>
48+
* </note>
4449
* <p>The <code>UpdateContainerAgent</code> API requires an Amazon ECS-optimized AMI or Amazon
4550
* Linux AMI with the <code>ecs-init</code> service installed and running. For help
4651
* updating the Amazon ECS container agent on other operating systems, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-update.html#manually_update_agent">Manually updating the Amazon ECS container agent</a> in the

clients/client-ecs/src/commands/UpdateTaskProtectionCommand.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,18 @@ export interface UpdateTaskProtectionCommandOutput extends UpdateTaskProtectionR
4343
* <code>protectionEnabled</code> set to <code>true</code>. You can keep extending the
4444
* protection expiration period of a task by invoking this operation repeatedly.</p>
4545
* <p>To learn more about Amazon ECS task protection, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-scale-in-protection.html">Task scale-in
46-
* protection</a> in the <i>Amazon Elastic Container Service Developer Guide</i>.</p>
46+
* protection</a> in the <i>
47+
* <i>Amazon Elastic Container Service Developer Guide</i>
48+
* </i>.</p>
4749
* <note>
4850
* <p>This operation is only supported for tasks belonging to an Amazon ECS service. Invoking
4951
* this operation for a standalone task will result in an <code>TASK_NOT_VALID</code>
50-
* failure. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/api_failures_messages.html.html">API
51-
* failure reasons</a>.</p>
52+
* failure. For more information, see <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/api_failures_messages.html">API failure
53+
* reasons</a>.</p>
5254
* </note>
5355
* <important>
5456
* <p>If you prefer to set task protection from within the container, we recommend using
55-
* the <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-endpoint.html">Amazon ECS container
56-
* agent endpoint</a>.</p>
57+
* the <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-scale-in-protection-endpoint.html">Task scale-in protection endpoint</a>.</p>
5758
* </important>
5859
* @example
5960
* Use a bare-bones client and the command you need to make an API call.

clients/client-ecs/src/commands/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export * from "./ListAccountSettingsCommand";
2525
export * from "./ListAttributesCommand";
2626
export * from "./ListClustersCommand";
2727
export * from "./ListContainerInstancesCommand";
28+
export * from "./ListServicesByNamespaceCommand";
2829
export * from "./ListServicesCommand";
2930
export * from "./ListTagsForResourceCommand";
3031
export * from "./ListTaskDefinitionFamiliesCommand";

0 commit comments

Comments
 (0)