Skip to content

Commit 816322a

Browse files
author
awstools
committed
feat(client-synthetics): This feature allows AWS Synthetics customers to provide code dependencies using lambda layer while creating a canary
1 parent 299bd9d commit 816322a

File tree

8 files changed

+146
-0
lines changed

8 files changed

+146
-0
lines changed

clients/client-synthetics/src/commands/CreateCanaryCommand.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ export interface CreateCanaryCommandOutput extends CreateCanaryResponse, __Metad
5656
* S3Version: "STRING_VALUE",
5757
* ZipFile: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("")
5858
* Handler: "STRING_VALUE", // required
59+
* Dependencies: [ // Dependencies
60+
* { // Dependency
61+
* Type: "LambdaLayer",
62+
* Reference: "STRING_VALUE", // required
63+
* },
64+
* ],
5965
* },
6066
* ArtifactS3Location: "STRING_VALUE", // required
6167
* ExecutionRoleArn: "STRING_VALUE", // required
@@ -110,6 +116,12 @@ export interface CreateCanaryCommandOutput extends CreateCanaryResponse, __Metad
110116
* // Code: { // CanaryCodeOutput
111117
* // SourceLocationArn: "STRING_VALUE",
112118
* // Handler: "STRING_VALUE",
119+
* // Dependencies: [ // Dependencies
120+
* // { // Dependency
121+
* // Type: "LambdaLayer",
122+
* // Reference: "STRING_VALUE", // required
123+
* // },
124+
* // ],
113125
* // },
114126
* // ExecutionRoleArn: "STRING_VALUE",
115127
* // Schedule: { // CanaryScheduleOutput

clients/client-synthetics/src/commands/DescribeCanariesCommand.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ export interface DescribeCanariesCommandOutput extends DescribeCanariesResponse,
6161
* // Code: { // CanaryCodeOutput
6262
* // SourceLocationArn: "STRING_VALUE",
6363
* // Handler: "STRING_VALUE",
64+
* // Dependencies: [ // Dependencies
65+
* // { // Dependency
66+
* // Type: "LambdaLayer",
67+
* // Reference: "STRING_VALUE", // required
68+
* // },
69+
* // ],
6470
* // },
6571
* // ExecutionRoleArn: "STRING_VALUE",
6672
* // Schedule: { // CanaryScheduleOutput

clients/client-synthetics/src/commands/GetCanaryCommand.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ export interface GetCanaryCommandOutput extends GetCanaryResponse, __MetadataBea
5050
* // Code: { // CanaryCodeOutput
5151
* // SourceLocationArn: "STRING_VALUE",
5252
* // Handler: "STRING_VALUE",
53+
* // Dependencies: [ // Dependencies
54+
* // { // Dependency
55+
* // Type: "LambdaLayer",
56+
* // Reference: "STRING_VALUE", // required
57+
* // },
58+
* // ],
5359
* // },
5460
* // ExecutionRoleArn: "STRING_VALUE",
5561
* // Schedule: { // CanaryScheduleOutput

clients/client-synthetics/src/commands/StartCanaryDryRunCommand.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ export interface StartCanaryDryRunCommandOutput extends StartCanaryDryRunRespons
4343
* S3Version: "STRING_VALUE",
4444
* ZipFile: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("")
4545
* Handler: "STRING_VALUE", // required
46+
* Dependencies: [ // Dependencies
47+
* { // Dependency
48+
* Type: "LambdaLayer",
49+
* Reference: "STRING_VALUE", // required
50+
* },
51+
* ],
4652
* },
4753
* RuntimeVersion: "STRING_VALUE",
4854
* RunConfig: { // CanaryRunConfigInput

clients/client-synthetics/src/commands/UpdateCanaryCommand.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ export interface UpdateCanaryCommandOutput extends UpdateCanaryResponse, __Metad
5050
* S3Version: "STRING_VALUE",
5151
* ZipFile: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("")
5252
* Handler: "STRING_VALUE", // required
53+
* Dependencies: [ // Dependencies
54+
* { // Dependency
55+
* Type: "LambdaLayer",
56+
* Reference: "STRING_VALUE", // required
57+
* },
58+
* ],
5359
* },
5460
* ExecutionRoleArn: "STRING_VALUE",
5561
* RuntimeVersion: "STRING_VALUE",

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

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,38 @@ export interface BaseScreenshot {
278278
IgnoreCoordinates?: string[] | undefined;
279279
}
280280

281+
/**
282+
* @public
283+
* @enum
284+
*/
285+
export const DependencyType = {
286+
LambdaLayer: "LambdaLayer",
287+
} as const;
288+
289+
/**
290+
* @public
291+
*/
292+
export type DependencyType = (typeof DependencyType)[keyof typeof DependencyType];
293+
294+
/**
295+
* <p>A structure that contains information about a dependency for a canary.</p>
296+
* @public
297+
*/
298+
export interface Dependency {
299+
/**
300+
* <p>The type of dependency. Valid value is <code>LambdaLayer</code>.</p>
301+
* @public
302+
*/
303+
Type?: DependencyType | undefined;
304+
305+
/**
306+
* <p>The dependency reference. For Lambda layers, this is the ARN of the Lambda layer. For more information
307+
* about Lambda ARN format, see <a href="https://docs.aws.amazon.com/lambda/latest/api/API_Layer.html">Lambda</a>.</p>
308+
* @public
309+
*/
310+
Reference: string | undefined;
311+
}
312+
281313
/**
282314
* <p>This structure contains information about the canary's Lambda handler and
283315
* where its code is stored by CloudWatch Synthetics.</p>
@@ -295,6 +327,12 @@ export interface CanaryCodeOutput {
295327
* @public
296328
*/
297329
Handler?: string | undefined;
330+
331+
/**
332+
* <p>A list of dependencies that are used for running this canary. The dependencies are specified as a key-value pair, where the key is the type of dependency and the value is the dependency reference.</p>
333+
* @public
334+
*/
335+
Dependencies?: Dependency[] | undefined;
298336
}
299337

300338
/**
@@ -969,6 +1007,12 @@ export interface CanaryCodeInput {
9691007
* @public
9701008
*/
9711009
Handler: string | undefined;
1010+
1011+
/**
1012+
* <p>A list of dependencies that should be used for running this canary. Specify the dependencies as a key-value pair, where the key is the type of dependency and the value is the dependency reference.</p>
1013+
* @public
1014+
*/
1015+
Dependencies?: Dependency[] | undefined;
9721016
}
9731017

9741018
/**

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ import {
7575
CanaryScheduleInput,
7676
CanaryTimeline,
7777
ConflictException,
78+
Dependency,
7879
Group,
7980
InternalFailureException,
8081
InternalServerException,
@@ -1301,6 +1302,7 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont
13011302
*/
13021303
const se_CanaryCodeInput = (input: CanaryCodeInput, context: __SerdeContext): any => {
13031304
return take(input, {
1305+
Dependencies: _json,
13041306
Handler: [],
13051307
S3Bucket: [],
13061308
S3Key: [],
@@ -1313,6 +1315,10 @@ const se_CanaryCodeInput = (input: CanaryCodeInput, context: __SerdeContext): an
13131315

13141316
// se_CanaryScheduleInput omitted.
13151317

1318+
// se_Dependencies omitted.
1319+
1320+
// se_Dependency omitted.
1321+
13161322
// se_DescribeCanariesLastRunNameFilter omitted.
13171323

13181324
// se_DescribeCanariesNameFilter omitted.
@@ -1467,6 +1473,10 @@ const de_CanaryTimeline = (output: any, context: __SerdeContext): CanaryTimeline
14671473
}) as any;
14681474
};
14691475

1476+
// de_Dependencies omitted.
1477+
1478+
// de_Dependency omitted.
1479+
14701480
// de_DryRunConfigOutput omitted.
14711481

14721482
/**

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

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,12 @@
369369
"smithy.api#documentation": "<p>The entry point to use for the source code when running the canary. For canaries that use the \n <code>syn-python-selenium-1.0</code> runtime\n or a <code>syn-nodejs.puppeteer</code> runtime earlier than <code>syn-nodejs.puppeteer-3.4</code>, \n the handler must be specified as <code>\n <i>fileName</i>.handler</code>. For \n <code>syn-python-selenium-1.1</code>, <code>syn-nodejs.puppeteer-3.4</code>, and later runtimes, the handler can be specified as \n <code>\n <i>fileName</i>.<i>functionName</i>\n </code>, or\n you can specify a folder where canary scripts reside as \n<code>\n <i>folder</i>/<i>fileName</i>.<i>functionName</i>\n </code>.</p>",
370370
"smithy.api#required": {}
371371
}
372+
},
373+
"Dependencies": {
374+
"target": "com.amazonaws.synthetics#Dependencies",
375+
"traits": {
376+
"smithy.api#documentation": "<p>A list of dependencies that should be used for running this canary. Specify the dependencies as a key-value pair, where the key is the type of dependency and the value is the dependency reference.</p>"
377+
}
372378
}
373379
},
374380
"traits": {
@@ -389,6 +395,12 @@
389395
"traits": {
390396
"smithy.api#documentation": "<p>The entry point to use for the source code when running the canary.</p>"
391397
}
398+
},
399+
"Dependencies": {
400+
"target": "com.amazonaws.synthetics#Dependencies",
401+
"traits": {
402+
"smithy.api#documentation": "<p>A list of dependencies that are used for running this canary. The dependencies are specified as a key-value pair, where the key is the type of dependency and the value is the dependency reference.</p>"
403+
}
392404
}
393405
},
394406
"traits": {
@@ -1284,6 +1296,50 @@
12841296
"smithy.api#output": {}
12851297
}
12861298
},
1299+
"com.amazonaws.synthetics#Dependencies": {
1300+
"type": "list",
1301+
"member": {
1302+
"target": "com.amazonaws.synthetics#Dependency"
1303+
},
1304+
"traits": {
1305+
"smithy.api#length": {
1306+
"min": 0,
1307+
"max": 1
1308+
}
1309+
}
1310+
},
1311+
"com.amazonaws.synthetics#Dependency": {
1312+
"type": "structure",
1313+
"members": {
1314+
"Type": {
1315+
"target": "com.amazonaws.synthetics#DependencyType",
1316+
"traits": {
1317+
"smithy.api#documentation": "<p>The type of dependency. Valid value is <code>LambdaLayer</code>.</p>"
1318+
}
1319+
},
1320+
"Reference": {
1321+
"target": "com.amazonaws.synthetics#String",
1322+
"traits": {
1323+
"smithy.api#documentation": "<p>The dependency reference. For Lambda layers, this is the ARN of the Lambda layer. For more information \n about Lambda ARN format, see <a href=\"https://docs.aws.amazon.com/lambda/latest/api/API_Layer.html\">Lambda</a>.</p>",
1324+
"smithy.api#required": {}
1325+
}
1326+
}
1327+
},
1328+
"traits": {
1329+
"smithy.api#documentation": "<p>A structure that contains information about a dependency for a canary.</p>"
1330+
}
1331+
},
1332+
"com.amazonaws.synthetics#DependencyType": {
1333+
"type": "enum",
1334+
"members": {
1335+
"LambdaLayer": {
1336+
"target": "smithy.api#Unit",
1337+
"traits": {
1338+
"smithy.api#enumValue": "LambdaLayer"
1339+
}
1340+
}
1341+
}
1342+
},
12871343
"com.amazonaws.synthetics#DescribeCanaries": {
12881344
"type": "operation",
12891345
"input": {

0 commit comments

Comments
 (0)