Skip to content

Commit b9d0925

Browse files
author
awstools
committed
feat(client-synthetics): Adds support to configure canaries with pre-configured blueprint code on supported runtime versions. This behavior can be controlled via the new BlueprintTypes property exposed in the CreateCanary and UpdateCanary APIs.
1 parent 084f288 commit b9d0925

File tree

8 files changed

+89
-9
lines changed

8 files changed

+89
-9
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ export interface CreateCanaryCommandOutput extends CreateCanaryResponse, __Metad
5757
* S3Key: "STRING_VALUE",
5858
* S3Version: "STRING_VALUE",
5959
* ZipFile: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("")
60-
* Handler: "STRING_VALUE", // required
60+
* Handler: "STRING_VALUE",
61+
* BlueprintTypes: [ // BlueprintTypes
62+
* "STRING_VALUE",
63+
* ],
6164
* Dependencies: [ // Dependencies
6265
* { // Dependency
6366
* Type: "LambdaLayer",
@@ -123,6 +126,9 @@ export interface CreateCanaryCommandOutput extends CreateCanaryResponse, __Metad
123126
* // Code: { // CanaryCodeOutput
124127
* // SourceLocationArn: "STRING_VALUE",
125128
* // Handler: "STRING_VALUE",
129+
* // BlueprintTypes: [ // BlueprintTypes
130+
* // "STRING_VALUE",
131+
* // ],
126132
* // Dependencies: [ // Dependencies
127133
* // { // Dependency
128134
* // Type: "LambdaLayer",

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ export interface DescribeCanariesCommandOutput extends DescribeCanariesResponse,
6363
* // Code: { // CanaryCodeOutput
6464
* // SourceLocationArn: "STRING_VALUE",
6565
* // Handler: "STRING_VALUE",
66+
* // BlueprintTypes: [ // BlueprintTypes
67+
* // "STRING_VALUE",
68+
* // ],
6669
* // Dependencies: [ // Dependencies
6770
* // { // Dependency
6871
* // Type: "LambdaLayer",

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ export interface GetCanaryCommandOutput extends GetCanaryResponse, __MetadataBea
5252
* // Code: { // CanaryCodeOutput
5353
* // SourceLocationArn: "STRING_VALUE",
5454
* // Handler: "STRING_VALUE",
55+
* // BlueprintTypes: [ // BlueprintTypes
56+
* // "STRING_VALUE",
57+
* // ],
5558
* // Dependencies: [ // Dependencies
5659
* // { // Dependency
5760
* // Type: "LambdaLayer",

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ export interface StartCanaryDryRunCommandOutput extends StartCanaryDryRunRespons
4444
* S3Key: "STRING_VALUE",
4545
* S3Version: "STRING_VALUE",
4646
* ZipFile: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("")
47-
* Handler: "STRING_VALUE", // required
47+
* Handler: "STRING_VALUE",
48+
* BlueprintTypes: [ // BlueprintTypes
49+
* "STRING_VALUE",
50+
* ],
4851
* Dependencies: [ // Dependencies
4952
* { // Dependency
5053
* Type: "LambdaLayer",

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ export interface UpdateCanaryCommandOutput extends UpdateCanaryResponse, __Metad
5858
* S3Key: "STRING_VALUE",
5959
* S3Version: "STRING_VALUE",
6060
* ZipFile: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("")
61-
* Handler: "STRING_VALUE", // required
61+
* Handler: "STRING_VALUE",
62+
* BlueprintTypes: [ // BlueprintTypes
63+
* "STRING_VALUE",
64+
* ],
6265
* Dependencies: [ // Dependencies
6366
* { // Dependency
6467
* Type: "LambdaLayer",

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

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,10 +350,21 @@ export interface CanaryCodeOutput {
350350

351351
/**
352352
* <p>The entry point to use for the source code when running the canary.</p>
353+
* <p>This field is required when you don't specify <code>BlueprintTypes</code> and is not allowed when you specify <code>BlueprintTypes</code>.</p>
353354
* @public
354355
*/
355356
Handler?: string | undefined;
356357

358+
/**
359+
* <p>
360+
* <code>BlueprintTypes</code> is a list of templates that enable simplified canary creation. You can create canaries for common monitoring scenarios by providing only a JSON configuration file instead of writing custom scripts. The only supported value is <code>multi-checks</code>.</p>
361+
* <p>Multi-checks monitors HTTP/DNS/SSL/TCP endpoints with built-in authentication schemes (Basic, API Key, OAuth, SigV4) and assertion capabilities. When you specify <code>BlueprintTypes</code>, the Handler field cannot be specified since the blueprint provides a pre-defined entry point.</p>
362+
* <p>
363+
* <code>BlueprintTypes</code> is supported only on canaries for syn-nodejs-3.0 runtime or later.</p>
364+
* @public
365+
*/
366+
BlueprintTypes?: string[] | undefined;
367+
357368
/**
358369
* <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>
359370
* @public
@@ -1089,9 +1100,20 @@ export interface CanaryCodeInput {
10891100
* <code>
10901101
* <i>folder</i>/<i>fileName</i>.<i>functionName</i>
10911102
* </code>.</p>
1103+
* <p>This field is required when you don't specify <code>BlueprintTypes</code> and is not allowed when you specify <code>BlueprintTypes</code>.</p>
1104+
* @public
1105+
*/
1106+
Handler?: string | undefined;
1107+
1108+
/**
1109+
* <p>
1110+
* <code>BlueprintTypes</code> is a list of templates that enable simplified canary creation. You can create canaries for common monitoring scenarios by providing only a JSON configuration file instead of writing custom scripts. The only supported value is <code>multi-checks</code>.</p>
1111+
* <p>Multi-checks monitors HTTP/DNS/SSL/TCP endpoints with built-in authentication schemes (Basic, API Key, OAuth, SigV4) and assertion capabilities. When you specify <code>BlueprintTypes</code>, the Handler field cannot be specified since the blueprint provides a pre-defined entry point.</p>
1112+
* <p>
1113+
* <code>BlueprintTypes</code> is supported only on canaries for syn-nodejs-3.0 runtime or later.</p>
10921114
* @public
10931115
*/
1094-
Handler: string | undefined;
1116+
BlueprintTypes?: string[] | undefined;
10951117

10961118
/**
10971119
* <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>

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,6 +1304,8 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont
13041304

13051305
// se_BaseScreenshots omitted.
13061306

1307+
// se_BlueprintTypes omitted.
1308+
13071309
// se_BrowserConfig omitted.
13081310

13091311
// se_BrowserConfigs omitted.
@@ -1313,6 +1315,7 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont
13131315
*/
13141316
const se_CanaryCodeInput = (input: CanaryCodeInput, context: __SerdeContext): any => {
13151317
return take(input, {
1318+
BlueprintTypes: _json,
13161319
Dependencies: _json,
13171320
Handler: [],
13181321
S3Bucket: [],
@@ -1362,6 +1365,8 @@ const se_CanaryCodeInput = (input: CanaryCodeInput, context: __SerdeContext): an
13621365

13631366
// de_BaseScreenshots omitted.
13641367

1368+
// de_BlueprintTypes omitted.
1369+
13651370
// de_BrowserConfig omitted.
13661371

13671372
// de_BrowserConfigs omitted.

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

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,28 @@
201201
}
202202
}
203203
},
204+
"com.amazonaws.synthetics#BlueprintType": {
205+
"type": "string",
206+
"traits": {
207+
"smithy.api#length": {
208+
"min": 1,
209+
"max": 128
210+
},
211+
"smithy.api#pattern": "^[0-9a-zA-Z_\\-\\.]+$"
212+
}
213+
},
214+
"com.amazonaws.synthetics#BlueprintTypes": {
215+
"type": "list",
216+
"member": {
217+
"target": "com.amazonaws.synthetics#BlueprintType"
218+
},
219+
"traits": {
220+
"smithy.api#length": {
221+
"min": 0,
222+
"max": 1
223+
}
224+
}
225+
},
204226
"com.amazonaws.synthetics#BrowserConfig": {
205227
"type": "structure",
206228
"members": {
@@ -427,8 +449,15 @@
427449
"Handler": {
428450
"target": "com.amazonaws.synthetics#CodeHandler",
429451
"traits": {
430-
"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>",
431-
"smithy.api#required": {}
452+
"smithy.api#addedDefault": {},
453+
"smithy.api#default": "",
454+
"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>\n <p>This field is required when you don't specify <code>BlueprintTypes</code> and is not allowed when you specify <code>BlueprintTypes</code>.</p>"
455+
}
456+
},
457+
"BlueprintTypes": {
458+
"target": "com.amazonaws.synthetics#BlueprintTypes",
459+
"traits": {
460+
"smithy.api#documentation": "<p>\n <code>BlueprintTypes</code> is a list of templates that enable simplified canary creation. You can create canaries for common monitoring scenarios by providing only a JSON configuration file instead of writing custom scripts. The only supported value is <code>multi-checks</code>.</p>\n <p>Multi-checks monitors HTTP/DNS/SSL/TCP endpoints with built-in authentication schemes (Basic, API Key, OAuth, SigV4) and assertion capabilities. When you specify <code>BlueprintTypes</code>, the Handler field cannot be specified since the blueprint provides a pre-defined entry point.</p>\n <p>\n <code>BlueprintTypes</code> is supported only on canaries for syn-nodejs-3.0 runtime or later.</p>"
432461
}
433462
},
434463
"Dependencies": {
@@ -454,7 +483,13 @@
454483
"Handler": {
455484
"target": "com.amazonaws.synthetics#String",
456485
"traits": {
457-
"smithy.api#documentation": "<p>The entry point to use for the source code when running the canary.</p>"
486+
"smithy.api#documentation": "<p>The entry point to use for the source code when running the canary.</p>\n <p>This field is required when you don't specify <code>BlueprintTypes</code> and is not allowed when you specify <code>BlueprintTypes</code>.</p>"
487+
}
488+
},
489+
"BlueprintTypes": {
490+
"target": "com.amazonaws.synthetics#BlueprintTypes",
491+
"traits": {
492+
"smithy.api#documentation": "<p>\n <code>BlueprintTypes</code> is a list of templates that enable simplified canary creation. You can create canaries for common monitoring scenarios by providing only a JSON configuration file instead of writing custom scripts. The only supported value is <code>multi-checks</code>.</p>\n <p>Multi-checks monitors HTTP/DNS/SSL/TCP endpoints with built-in authentication schemes (Basic, API Key, OAuth, SigV4) and assertion capabilities. When you specify <code>BlueprintTypes</code>, the Handler field cannot be specified since the blueprint provides a pre-defined entry point.</p>\n <p>\n <code>BlueprintTypes</code> is supported only on canaries for syn-nodejs-3.0 runtime or later.</p>"
458493
}
459494
},
460495
"Dependencies": {
@@ -1022,10 +1057,10 @@
10221057
"type": "string",
10231058
"traits": {
10241059
"smithy.api#length": {
1025-
"min": 1,
1060+
"min": 0,
10261061
"max": 128
10271062
},
1028-
"smithy.api#pattern": "^([0-9a-zA-Z_-]+(\\/|\\.))*[0-9A-Za-z_\\\\-]+(\\.|::)[A-Za-z_][A-Za-z0-9_]*$"
1063+
"smithy.api#pattern": "^(([0-9a-zA-Z_-]+(\\/|\\.))*[0-9A-Za-z_\\\\-]+(\\.|::)[A-Za-z_][A-Za-z0-9_]*)?$"
10291064
}
10301065
},
10311066
"com.amazonaws.synthetics#ConflictException": {

0 commit comments

Comments
 (0)