Skip to content

Commit 7283ff5

Browse files
author
awstools
committed
feat(client-deadline): Adds support for tag management on workers and tag inheritance from fleets to their associated workers.
1 parent e2fb477 commit 7283ff5

File tree

10 files changed

+114
-32
lines changed

10 files changed

+114
-32
lines changed

clients/client-deadline/src/commands/CreateFleetCommand.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ export interface CreateFleetCommandOutput extends CreateFleetResponse, __Metadat
8787
* ],
8888
* },
8989
* storageProfileId: "STRING_VALUE",
90+
* tagPropagationMode: "NO_PROPAGATION" || "PROPAGATE_TAGS_TO_WORKERS_AT_LAUNCH",
9091
* },
9192
* serviceManagedEc2: { // ServiceManagedEc2FleetConfiguration
9293
* instanceCapabilities: { // ServiceManagedEc2InstanceCapabilities

clients/client-deadline/src/commands/CreateWorkerCommand.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ export interface CreateWorkerCommandOutput extends CreateWorkerResponse, __Metad
5353
* hostName: "STRING_VALUE",
5454
* },
5555
* clientToken: "STRING_VALUE",
56+
* tags: { // Tags
57+
* "<keys>": "STRING_VALUE",
58+
* },
5659
* };
5760
* const command = new CreateWorkerCommand(input);
5861
* const response = await client.send(command);

clients/client-deadline/src/commands/GetFleetCommand.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ export interface GetFleetCommandOutput extends GetFleetResponse, __MetadataBeare
9494
* // ],
9595
* // },
9696
* // storageProfileId: "STRING_VALUE",
97+
* // tagPropagationMode: "NO_PROPAGATION" || "PROPAGATE_TAGS_TO_WORKERS_AT_LAUNCH",
9798
* // },
9899
* // serviceManagedEc2: { // ServiceManagedEc2FleetConfiguration
99100
* // instanceCapabilities: { // ServiceManagedEc2InstanceCapabilities

clients/client-deadline/src/commands/ListFleetsCommand.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ export interface ListFleetsCommandOutput extends ListFleetsResponse, __MetadataB
9999
* // ],
100100
* // },
101101
* // storageProfileId: "STRING_VALUE",
102+
* // tagPropagationMode: "NO_PROPAGATION" || "PROPAGATE_TAGS_TO_WORKERS_AT_LAUNCH",
102103
* // },
103104
* // serviceManagedEc2: { // ServiceManagedEc2FleetConfiguration
104105
* // instanceCapabilities: { // ServiceManagedEc2InstanceCapabilities

clients/client-deadline/src/commands/ListTasksCommand.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
66

77
import { DeadlineClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DeadlineClient";
88
import { commonParams } from "../endpoint/EndpointParameters";
9-
import { ListTasksRequest, ListTasksResponse, ListTasksResponseFilterSensitiveLog } from "../models/models_0";
9+
import { ListTasksRequest } from "../models/models_0";
10+
import { ListTasksResponse, ListTasksResponseFilterSensitiveLog } from "../models/models_1";
1011
import { de_ListTasksCommand, se_ListTasksCommand } from "../protocols/Aws_restJson1";
1112

1213
/**

clients/client-deadline/src/commands/UpdateFleetCommand.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ export interface UpdateFleetCommandOutput extends UpdateFleetResponse, __Metadat
8686
* ],
8787
* },
8888
* storageProfileId: "STRING_VALUE",
89+
* tagPropagationMode: "NO_PROPAGATION" || "PROPAGATE_TAGS_TO_WORKERS_AT_LAUNCH",
8990
* },
9091
* serviceManagedEc2: { // ServiceManagedEc2FleetConfiguration
9192
* instanceCapabilities: { // ServiceManagedEc2InstanceCapabilities

clients/client-deadline/src/models/models_0.ts

Lines changed: 33 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3057,6 +3057,20 @@ export interface CreateFarmResponse {
30573057
farmId: string | undefined;
30583058
}
30593059

3060+
/**
3061+
* @public
3062+
* @enum
3063+
*/
3064+
export const TagPropagationMode = {
3065+
NO_PROPAGATION: "NO_PROPAGATION",
3066+
PROPAGATE_TAGS_TO_WORKERS_AT_LAUNCH: "PROPAGATE_TAGS_TO_WORKERS_AT_LAUNCH",
3067+
} as const;
3068+
3069+
/**
3070+
* @public
3071+
*/
3072+
export type TagPropagationMode = (typeof TagPropagationMode)[keyof typeof TagPropagationMode];
3073+
30603074
/**
30613075
* <p>The fleet amount and attribute capabilities.</p>
30623076
* @public
@@ -3233,6 +3247,19 @@ export interface CustomerManagedFleetConfiguration {
32333247
* @public
32343248
*/
32353249
storageProfileId?: string | undefined;
3250+
3251+
/**
3252+
* <p>Specifies whether tags associated with a fleet are attached to workers when the worker
3253+
* is launched. </p>
3254+
* <p>When the <code>tagPropagationMode</code> is set to
3255+
* <code>PROPAGATE_TAGS_TO_WORKERS_AT_LAUNCH</code> any tag associated with a fleet is
3256+
* attached to workers when they launch. If the tags for a fleet change, the tags associated
3257+
* with running workers <b>do not</b> change.</p>
3258+
* <p>If you don't specify <code>tagPropagationMode</code>, the default is
3259+
* <code>NO_PROPAGATION</code>.</p>
3260+
* @public
3261+
*/
3262+
tagPropagationMode?: TagPropagationMode | undefined;
32363263
}
32373264

32383265
/**
@@ -4205,6 +4232,12 @@ export interface CreateWorkerRequest {
42054232
* @public
42064233
*/
42074234
clientToken?: string | undefined;
4235+
4236+
/**
4237+
* <p>Each tag consists of a tag key and a tag value. Tag keys and values are both required, but tag values can be empty strings.</p>
4238+
* @public
4239+
*/
4240+
tags?: Record<string, string> | undefined;
42084241
}
42094242

42104243
/**
@@ -8854,23 +8887,6 @@ export interface TaskSummary {
88548887
latestSessionActionId?: string | undefined;
88558888
}
88568889

8857-
/**
8858-
* @public
8859-
*/
8860-
export interface ListTasksResponse {
8861-
/**
8862-
* <p>Tasks for the job.</p>
8863-
* @public
8864-
*/
8865-
tasks: TaskSummary[] | undefined;
8866-
8867-
/**
8868-
* <p>If Deadline Cloud returns <code>nextToken</code>, then there are more results available. The value of <code>nextToken</code> is a unique pagination token for each page. To retrieve the next page, call the operation again using the returned token. Keep all other arguments unchanged. If no results remain, then <code>nextToken</code> is set to <code>null</code>. Each pagination token expires after 24 hours. If you provide a token that isn't valid, then you receive an HTTP 400 <code>ValidationException</code> error.</p>
8869-
* @public
8870-
*/
8871-
nextToken?: string | undefined;
8872-
}
8873-
88748890
/**
88758891
* @internal
88768892
*/
@@ -9345,11 +9361,3 @@ export const TaskSummaryFilterSensitiveLog = (obj: TaskSummary): any => ({
93459361
...obj,
93469362
...(obj.parameters && { parameters: SENSITIVE_STRING }),
93479363
});
9348-
9349-
/**
9350-
* @internal
9351-
*/
9352-
export const ListTasksResponseFilterSensitiveLog = (obj: ListTasksResponse): any => ({
9353-
...obj,
9354-
...(obj.tasks && { tasks: obj.tasks.map((item) => TaskSummaryFilterSensitiveLog(item)) }),
9355-
});

clients/client-deadline/src/models/models_1.ts

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,29 @@ import {
2525
StorageProfileSummary,
2626
TaskParameterValue,
2727
TaskRunStatus,
28+
TaskSummary,
29+
TaskSummaryFilterSensitiveLog,
2830
TaskTargetRunStatus,
2931
WorkerStatus,
3032
} from "./models_0";
3133

34+
/**
35+
* @public
36+
*/
37+
export interface ListTasksResponse {
38+
/**
39+
* <p>Tasks for the job.</p>
40+
* @public
41+
*/
42+
tasks: TaskSummary[] | undefined;
43+
44+
/**
45+
* <p>If Deadline Cloud returns <code>nextToken</code>, then there are more results available. The value of <code>nextToken</code> is a unique pagination token for each page. To retrieve the next page, call the operation again using the returned token. Keep all other arguments unchanged. If no results remain, then <code>nextToken</code> is set to <code>null</code>. Each pagination token expires after 24 hours. If you provide a token that isn't valid, then you receive an HTTP 400 <code>ValidationException</code> error.</p>
46+
* @public
47+
*/
48+
nextToken?: string | undefined;
49+
}
50+
3251
/**
3352
* @public
3453
* @enum
@@ -2165,11 +2184,13 @@ export interface SearchTermFilterExpression {
21652184
* <ul>
21662185
* <li>
21672186
* <p>
2168-
* <code>FUZZY_MATCH</code> - Matches if a portion of the search term is found in the result.</p>
2187+
* <code>FUZZY_MATCH</code> - Matches if a portion of the search term is found in the
2188+
* result.</p>
21692189
* </li>
21702190
* <li>
21712191
* <p>
2172-
* <code>CONTAINS</code> - Matches if the exact search term is contained in the result.</p>
2192+
* <code>CONTAINS</code> - Matches if the exact search term is contained in the
2193+
* result.</p>
21732194
* </li>
21742195
* </ul>
21752196
* @public
@@ -3491,6 +3512,14 @@ export interface SearchWorkersRequest {
34913512
pageSize?: number | undefined;
34923513
}
34933514

3515+
/**
3516+
* @internal
3517+
*/
3518+
export const ListTasksResponseFilterSensitiveLog = (obj: ListTasksResponse): any => ({
3519+
...obj,
3520+
...(obj.tasks && { tasks: obj.tasks.map((item) => TaskSummaryFilterSensitiveLog(item)) }),
3521+
});
3522+
34943523
/**
34953524
* @internal
34963525
*/

clients/client-deadline/src/protocols/Aws_restJson1.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,6 +1174,7 @@ export const se_CreateWorkerCommand = async (
11741174
body = JSON.stringify(
11751175
take(input, {
11761176
hostProperties: (_) => _json(_),
1177+
tags: (_) => _json(_),
11771178
})
11781179
);
11791180
let { hostname: resolvedHostname } = await context.endpoint();
@@ -6504,6 +6505,7 @@ const se_CustomerManagedFleetConfiguration = (
65046505
return take(input, {
65056506
mode: [],
65066507
storageProfileId: [],
6508+
tagPropagationMode: [],
65076509
workerCapabilities: (_) => se_CustomerManagedWorkerCapabilities(_, context),
65086510
});
65096511
};
@@ -6938,6 +6940,7 @@ const de_CustomerManagedFleetConfiguration = (
69386940
return take(output, {
69396941
mode: __expectString,
69406942
storageProfileId: __expectString,
6943+
tagPropagationMode: __expectString,
69416944
workerCapabilities: (_: any) => de_CustomerManagedWorkerCapabilities(_, context),
69426945
}) as any;
69436946
};

codegen/sdk-codegen/aws-models/deadline.json

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3684,6 +3684,12 @@
36843684
"smithy.api#httpHeader": "X-Amz-Client-Token",
36853685
"smithy.api#idempotencyToken": {}
36863686
}
3687+
},
3688+
"tags": {
3689+
"target": "com.amazonaws.deadline#Tags",
3690+
"traits": {
3691+
"smithy.api#documentation": "<p>Each tag consists of a tag key and a tag value. Tag keys and values are both required, but tag values can be empty strings.</p>"
3692+
}
36873693
}
36883694
},
36893695
"traits": {
@@ -3760,6 +3766,12 @@
37603766
"traits": {
37613767
"smithy.api#documentation": "<p>The storage profile ID.</p>"
37623768
}
3769+
},
3770+
"tagPropagationMode": {
3771+
"target": "com.amazonaws.deadline#TagPropagationMode",
3772+
"traits": {
3773+
"smithy.api#documentation": "<p>Specifies whether tags associated with a fleet are attached to workers when the worker\n is launched. </p>\n <p>When the <code>tagPropagationMode</code> is set to\n <code>PROPAGATE_TAGS_TO_WORKERS_AT_LAUNCH</code> any tag associated with a fleet is\n attached to workers when they launch. If the tags for a fleet change, the tags associated\n with running workers <b>do not</b> change.</p>\n <p>If you don't specify <code>tagPropagationMode</code>, the default is\n <code>NO_PROPAGATION</code>.</p>"
3774+
}
37633775
}
37643776
},
37653777
"traits": {
@@ -4024,6 +4036,11 @@
40244036
"type": "String",
40254037
"documentation": "Filters access by the membership level passed in the request",
40264038
"externalDocumentation": "${ContextKeysDocRoot}"
4039+
},
4040+
"deadline:CalledAction": {
4041+
"type": "String",
4042+
"documentation": "Filters access by the allowed action in the request",
4043+
"externalDocumentation": "${ContextKeysDocRoot}"
40274044
}
40284045
},
40294046
"aws.protocols#restJson1": {},
@@ -11520,7 +11537,7 @@
1152011537
"traits": {
1152111538
"smithy.api#length": {
1152211539
"min": 1,
11523-
"max": 300000
11540+
"max": 1000000
1152411541
},
1152511542
"smithy.api#sensitive": {}
1152611543
}
@@ -14685,7 +14702,7 @@
1468514702
}
1468614703
],
1468714704
"traits": {
14688-
"aws.iam#conditionKeys": [],
14705+
"aws.iam#conditionKeys": ["deadline:CalledAction"],
1468914706
"aws.iam#iamAction": {
1469014707
"name": "ListTagsForResource",
1469114708
"documentation": "Grants permission to list all tags on specified Deadline Cloud resources"
@@ -17052,7 +17069,7 @@
1705217069
"target": "com.amazonaws.deadline#SearchTermMatchingType",
1705317070
"traits": {
1705417071
"smithy.api#default": "FUZZY_MATCH",
17055-
"smithy.api#documentation": "<p>Specifies how Deadline Cloud matches your search term in the results. If you don't\n specify a <code>matchType</code> the default is <code>FUZZY_MATCH</code>.</p>\n <ul>\n <li>\n <p>\n <code>FUZZY_MATCH</code> - Matches if a portion of the search term is found in the result.</p>\n </li>\n <li>\n <p>\n <code>CONTAINS</code> - Matches if the exact search term is contained in the result.</p>\n </li>\n </ul>"
17072+
"smithy.api#documentation": "<p>Specifies how Deadline Cloud matches your search term in the results. If you don't\n specify a <code>matchType</code> the default is <code>FUZZY_MATCH</code>.</p>\n <ul>\n <li>\n <p>\n <code>FUZZY_MATCH</code> - Matches if a portion of the search term is found in the\n result.</p>\n </li>\n <li>\n <p>\n <code>CONTAINS</code> - Matches if the exact search term is contained in the\n result.</p>\n </li>\n </ul>"
1705617073
}
1705717074
}
1705817075
},
@@ -18930,6 +18947,23 @@
1893018947
"smithy.api#documentation": "<p>The details of a synced job attachment.</p>"
1893118948
}
1893218949
},
18950+
"com.amazonaws.deadline#TagPropagationMode": {
18951+
"type": "enum",
18952+
"members": {
18953+
"NO_PROPAGATION": {
18954+
"target": "smithy.api#Unit",
18955+
"traits": {
18956+
"smithy.api#enumValue": "NO_PROPAGATION"
18957+
}
18958+
},
18959+
"PROPAGATE_TAGS_TO_WORKERS_AT_LAUNCH": {
18960+
"target": "smithy.api#Unit",
18961+
"traits": {
18962+
"smithy.api#enumValue": "PROPAGATE_TAGS_TO_WORKERS_AT_LAUNCH"
18963+
}
18964+
}
18965+
}
18966+
},
1893318967
"com.amazonaws.deadline#TagResource": {
1893418968
"type": "operation",
1893518969
"input": {
@@ -18959,7 +18993,7 @@
1895918993
}
1896018994
],
1896118995
"traits": {
18962-
"aws.iam#conditionKeys": ["aws:RequestTag/${TagKey}", "aws:TagKeys"],
18996+
"aws.iam#conditionKeys": ["aws:RequestTag/${TagKey}", "aws:TagKeys", "deadline:CalledAction"],
1896318997
"aws.iam#iamAction": {
1896418998
"name": "TagResource",
1896518999
"documentation": "Grants permission to add or overwrite one or more tags for the specified Deadline Cloud resource"

0 commit comments

Comments
 (0)