Skip to content

Commit 9d8cf33

Browse files
author
awstools
committed
feat(client-synthetics): This release introduces two features. The first is tag replication, which allows for the propagation of canary tags onto Synthetics related resources, such as Lambda functions. The second is a limit increase in canary name length, which has now been increased from 21 to 255 characters.
1 parent d4befea commit 9d8cf33

File tree

5 files changed

+93
-13
lines changed

5 files changed

+93
-13
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ export interface CreateCanaryCommandOutput extends CreateCanaryResponse, __Metad
8282
* "STRING_VALUE",
8383
* ],
8484
* },
85+
* ResourcesToReplicateTags: [ // ResourceList
86+
* "lambda-function",
87+
* ],
8588
* Tags: { // TagMap
8689
* "<keys>": "STRING_VALUE",
8790
* },

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,25 @@ export interface DeleteCanaryCommandOutput extends DeleteCanaryResponse, __Metad
3838
* <ul>
3939
* <li>
4040
* <p>The CloudWatch alarms created for this canary. These alarms have a name of
41-
* <code>Synthetics-SharpDrop-Alarm-<i>MyCanaryName</i>
42-
* </code>.</p>
41+
* <code>Synthetics-Alarm-<i>first-198-characters-of-canary-name</i>-<i>canaryId</i>-<i>alarm number</i>
42+
* </code>
43+
* </p>
4344
* </li>
4445
* <li>
4546
* <p>Amazon S3 objects and buckets, such as the canary's artifact location.</p>
4647
* </li>
4748
* <li>
4849
* <p>IAM roles created for the canary. If they were created in the console, these roles
4950
* have the name <code>
50-
* role/service-role/CloudWatchSyntheticsRole-<i>MyCanaryName</i>
51-
* </code>.</p>
51+
* role/service-role/CloudWatchSyntheticsRole-<i>First-21-Characters-of-CanaryName</i>
52+
* </code>
53+
* </p>
5254
* </li>
5355
* <li>
5456
* <p>CloudWatch Logs log groups created for the canary. These logs groups have the name
55-
* <code>/aws/lambda/cwsyn-<i>MyCanaryName</i>
56-
* </code>. </p>
57+
* <code>/aws/lambda/cwsyn-<i>First-21-Characters-of-CanaryName</i>
58+
* </code>
59+
* </p>
5760
* </li>
5861
* </ul>
5962
* <p>Before you delete a canary, you might want to use <code>GetCanary</code> to display

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

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,23 @@ export interface CanaryLastRun {
736736
* script is stored in an S3 bucket, the bucket name, key, and version are also included. If
737737
* the script was passed into the canary directly, the script code is contained in the value
738738
* of <code>Zipfile</code>. </p>
739+
* <p>If you are uploading your canary scripts with an Amazon S3 bucket, your zip file should include your
740+
* script in a certain folder structure.</p>
741+
* <ul>
742+
* <li>
743+
* <p>For Node.js canaries, the folder structure must be <code>nodejs/node_modules/<i>myCanaryFilename.js</i>
744+
* </code>
745+
* For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_WritingCanary_Nodejs.html#CloudWatch_Synthetics_Canaries_package">Packaging your Node.js canary files</a>
746+
* </p>
747+
* </li>
748+
* <li>
749+
* <p>For Python canaries, the folder structure must be <code>python/<i>myCanaryFilename.p</i>
750+
* </code> or <code>python/<i>myFolder/myCanaryFilename.py</i>
751+
* </code>
752+
* For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_WritingCanary_Python.html#CloudWatch_Synthetics_Canaries_WritingCanary_Python_package">Packaging your Python canary files</a>
753+
* </p>
754+
* </li>
755+
* </ul>
739756
* @public
740757
*/
741758
export interface CanaryCodeInput {
@@ -872,6 +889,19 @@ export interface CanaryScheduleInput {
872889
DurationInSeconds?: number;
873890
}
874891

892+
/**
893+
* @public
894+
* @enum
895+
*/
896+
export const ResourceToTag = {
897+
LAMBDA_FUNCTION: "lambda-function",
898+
} as const;
899+
900+
/**
901+
* @public
902+
*/
903+
export type ResourceToTag = (typeof ResourceToTag)[keyof typeof ResourceToTag];
904+
875905
/**
876906
* <p>If this canary is to test an endpoint in a VPC, this structure contains
877907
* information about the subnets and security groups of the VPC endpoint.
@@ -1020,13 +1050,24 @@ export interface CreateCanaryRequest {
10201050
*/
10211051
VpcConfig?: VpcConfigInput;
10221052

1053+
/**
1054+
* <p>To have the tags that you apply to this canary also be applied to the Lambda function that
1055+
* the canary uses, specify this parameter with the value <code>lambda-function</code>.</p>
1056+
* <p>If you specify this parameter and don't specify any tags in the <code>Tags</code>
1057+
* parameter, the canary creation fails.</p>
1058+
* @public
1059+
*/
1060+
ResourcesToReplicateTags?: ResourceToTag[];
1061+
10231062
/**
10241063
* <p>A list of key-value pairs to associate with the canary.
10251064
* You can associate as many as 50 tags with a canary.</p>
10261065
* <p>Tags can help you organize and categorize your
10271066
* resources. You can also use them to scope user permissions, by
10281067
* granting a user permission to access or change only the resources that have
10291068
* certain tag values.</p>
1069+
* <p>To have the tags that you apply to this canary also be applied to the Lambda function that
1070+
* the canary uses, specify this parameter with the value <code>lambda-function</code>.</p>
10301071
* @public
10311072
*/
10321073
Tags?: Record<string, string>;
@@ -1203,7 +1244,7 @@ export interface DescribeCanariesRequest {
12031244

12041245
/**
12051246
* <p>Specify this parameter to limit how many canaries are returned each time you use
1206-
* the <code>DescribeCanaries</code> operation. If you omit this parameter, the default of 100 is used.</p>
1247+
* the <code>DescribeCanaries</code> operation. If you omit this parameter, the default of 20 is used.</p>
12071248
* @public
12081249
*/
12091250
MaxResults?: number;

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ import {
7979
NotFoundException,
8080
RequestEntityTooLargeException,
8181
ResourceNotFoundException,
82+
ResourceToTag,
8283
RuntimeVersion,
8384
S3EncryptionConfig,
8485
ServiceQuotaExceededException,
@@ -133,6 +134,7 @@ export const se_CreateCanaryCommand = async (
133134
ExecutionRoleArn: [],
134135
FailureRetentionPeriodInDays: [],
135136
Name: [],
137+
ResourcesToReplicateTags: (_) => _json(_),
136138
RunConfig: (_) => _json(_),
137139
RuntimeVersion: [],
138140
Schedule: (_) => _json(_),
@@ -1232,6 +1234,8 @@ const se_CanaryCodeInput = (input: CanaryCodeInput, context: __SerdeContext): an
12321234

12331235
// se_EnvironmentVariablesMap omitted.
12341236

1237+
// se_ResourceList omitted.
1238+
12351239
// se_S3EncryptionConfig omitted.
12361240

12371241
// se_SecurityGroupIds omitted.

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

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@
308308
"min": 1,
309309
"max": 2048
310310
},
311-
"smithy.api#pattern": "^arn:(aws[a-zA-Z-]*)?:synthetics:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\\d{1}:\\d{12}:canary:[0-9a-z_\\-]{1,21}$"
311+
"smithy.api#pattern": "^arn:(aws[a-zA-Z-]*)?:synthetics:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\\d{1}:\\d{12}:canary:[0-9a-z_\\-]{1,255}$"
312312
}
313313
},
314314
"com.amazonaws.synthetics#CanaryCodeInput": {
@@ -347,7 +347,7 @@
347347
}
348348
},
349349
"traits": {
350-
"smithy.api#documentation": "<p>Use this structure to input your script code for the canary. This structure contains the\n Lambda handler with the location where the canary should start running the script. If the\n script is stored in an S3 bucket, the bucket name, key, and version are also included. If\n the script was passed into the canary directly, the script code is contained in the value\n of <code>Zipfile</code>. </p>"
350+
"smithy.api#documentation": "<p>Use this structure to input your script code for the canary. This structure contains the\n Lambda handler with the location where the canary should start running the script. If the\n script is stored in an S3 bucket, the bucket name, key, and version are also included. If\n the script was passed into the canary directly, the script code is contained in the value\n of <code>Zipfile</code>. </p>\n <p>If you are uploading your canary scripts with an Amazon S3 bucket, your zip file should include your \n script in a certain folder structure.</p>\n <ul>\n <li>\n <p>For Node.js canaries, the folder structure must be <code>nodejs/node_modules/<i>myCanaryFilename.js</i>\n </code>\n For more information, see <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_WritingCanary_Nodejs.html#CloudWatch_Synthetics_Canaries_package\">Packaging your Node.js canary files</a>\n </p>\n </li>\n <li>\n <p>For Python canaries, the folder structure must be <code>python/<i>myCanaryFilename.p</i>\n </code> or <code>python/<i>myFolder/myCanaryFilename.py</i>\n </code>\n For more information, see <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_WritingCanary_Python.html#CloudWatch_Synthetics_Canaries_WritingCanary_Python_package\">Packaging your Python canary files</a>\n </p>\n </li>\n </ul>"
351351
}
352352
},
353353
"com.amazonaws.synthetics#CanaryCodeOutput": {
@@ -395,7 +395,7 @@
395395
"traits": {
396396
"smithy.api#length": {
397397
"min": 1,
398-
"max": 21
398+
"max": 255
399399
},
400400
"smithy.api#pattern": "^[0-9a-z_\\-]+$"
401401
}
@@ -943,10 +943,16 @@
943943
"smithy.api#documentation": "<p>If this canary is to test an endpoint in a VPC, this structure contains\n information about the subnet and security groups of the VPC endpoint. \n For more information, see <a href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_VPC.html\">\n Running a Canary in a VPC</a>.</p>"
944944
}
945945
},
946+
"ResourcesToReplicateTags": {
947+
"target": "com.amazonaws.synthetics#ResourceList",
948+
"traits": {
949+
"smithy.api#documentation": "<p>To have the tags that you apply to this canary also be applied to the Lambda function that\n the canary uses, specify this parameter with the value <code>lambda-function</code>.</p>\n <p>If you specify this parameter and don't specify any tags in the <code>Tags</code>\n parameter, the canary creation fails.</p>"
950+
}
951+
},
946952
"Tags": {
947953
"target": "com.amazonaws.synthetics#TagMap",
948954
"traits": {
949-
"smithy.api#documentation": "<p>A list of key-value pairs to associate with the canary. \n You can associate as many as 50 tags with a canary.</p>\n <p>Tags can help you organize and categorize your\n resources. You can also use them to scope user permissions, by \n granting a user permission to access or change only the resources that have\n certain tag values.</p>"
955+
"smithy.api#documentation": "<p>A list of key-value pairs to associate with the canary. \n You can associate as many as 50 tags with a canary.</p>\n <p>Tags can help you organize and categorize your\n resources. You can also use them to scope user permissions, by \n granting a user permission to access or change only the resources that have\n certain tag values.</p>\n <p>To have the tags that you apply to this canary also be applied to the Lambda function that\n the canary uses, specify this parameter with the value <code>lambda-function</code>.</p>"
950956
}
951957
},
952958
"ArtifactConfig": {
@@ -1063,7 +1069,7 @@
10631069
}
10641070
],
10651071
"traits": {
1066-
"smithy.api#documentation": "<p>Permanently deletes the specified canary.</p>\n <p>If you specify <code>DeleteLambda</code> to <code>true</code>, CloudWatch Synthetics also deletes\n the Lambda functions and layers that are used by the canary.</p>\n <p>Other resources used and created by the canary are not automatically deleted. \n After you delete a canary that you do not intend to\n use again, you\n should also delete the following:</p>\n <ul>\n <li>\n <p>The CloudWatch alarms created for this canary. These alarms have a name of\n <code>Synthetics-SharpDrop-Alarm-<i>MyCanaryName</i>\n </code>.</p>\n </li>\n <li>\n <p>Amazon S3 objects and buckets, such as the canary's artifact location.</p>\n </li>\n <li>\n <p>IAM roles created for the canary. If they were created in the console, these roles\n have the name <code>\n role/service-role/CloudWatchSyntheticsRole-<i>MyCanaryName</i>\n </code>.</p>\n </li>\n <li>\n <p>CloudWatch Logs log groups created for the canary. These logs groups have the name\n <code>/aws/lambda/cwsyn-<i>MyCanaryName</i>\n </code>. </p>\n </li>\n </ul>\n <p>Before you delete a canary, you might want to use <code>GetCanary</code> to display\n the information about this canary. Make\n note of the information returned by this operation so that you can delete these resources\n after you delete the canary.</p>",
1072+
"smithy.api#documentation": "<p>Permanently deletes the specified canary.</p>\n <p>If you specify <code>DeleteLambda</code> to <code>true</code>, CloudWatch Synthetics also deletes\n the Lambda functions and layers that are used by the canary.</p>\n <p>Other resources used and created by the canary are not automatically deleted. \n After you delete a canary that you do not intend to\n use again, you\n should also delete the following:</p>\n <ul>\n <li>\n <p>The CloudWatch alarms created for this canary. These alarms have a name of\n <code>Synthetics-Alarm-<i>first-198-characters-of-canary-name</i>-<i>canaryId</i>-<i>alarm number</i>\n </code>\n </p>\n </li>\n <li>\n <p>Amazon S3 objects and buckets, such as the canary's artifact location.</p>\n </li>\n <li>\n <p>IAM roles created for the canary. If they were created in the console, these roles\n have the name <code>\n role/service-role/CloudWatchSyntheticsRole-<i>First-21-Characters-of-CanaryName</i>\n </code>\n </p>\n </li>\n <li>\n <p>CloudWatch Logs log groups created for the canary. These logs groups have the name\n <code>/aws/lambda/cwsyn-<i>First-21-Characters-of-CanaryName</i>\n </code>\n </p>\n </li>\n </ul>\n <p>Before you delete a canary, you might want to use <code>GetCanary</code> to display\n the information about this canary. Make\n note of the information returned by this operation so that you can delete these resources\n after you delete the canary.</p>",
10671073
"smithy.api#http": {
10681074
"method": "DELETE",
10691075
"uri": "/canary/{Name}",
@@ -1298,7 +1304,7 @@
12981304
"MaxResults": {
12991305
"target": "com.amazonaws.synthetics#MaxCanaryResults",
13001306
"traits": {
1301-
"smithy.api#documentation": "<p>Specify this parameter to limit how many canaries are returned each time you use\n the <code>DescribeCanaries</code> operation. If you omit this parameter, the default of 100 is used.</p>"
1307+
"smithy.api#documentation": "<p>Specify this parameter to limit how many canaries are returned each time you use\n the <code>DescribeCanaries</code> operation. If you omit this parameter, the default of 20 is used.</p>"
13021308
}
13031309
},
13041310
"Names": {
@@ -2259,6 +2265,18 @@
22592265
"smithy.api#pattern": "^arn:(aws[a-zA-Z-]*)?:synthetics:[a-z]{2}((-gov)|(-iso(b?)))?-[a-z]+-\\d{1}:\\d{12}:(canary|group):[0-9a-z_\\-]+$"
22602266
}
22612267
},
2268+
"com.amazonaws.synthetics#ResourceList": {
2269+
"type": "list",
2270+
"member": {
2271+
"target": "com.amazonaws.synthetics#ResourceToTag"
2272+
},
2273+
"traits": {
2274+
"smithy.api#length": {
2275+
"min": 1,
2276+
"max": 1
2277+
}
2278+
}
2279+
},
22622280
"com.amazonaws.synthetics#ResourceNotFoundException": {
22632281
"type": "structure",
22642282
"members": {
@@ -2272,6 +2290,17 @@
22722290
"smithy.api#httpError": 404
22732291
}
22742292
},
2293+
"com.amazonaws.synthetics#ResourceToTag": {
2294+
"type": "enum",
2295+
"members": {
2296+
"LAMBDA_FUNCTION": {
2297+
"target": "smithy.api#Unit",
2298+
"traits": {
2299+
"smithy.api#enumValue": "lambda-function"
2300+
}
2301+
}
2302+
}
2303+
},
22752304
"com.amazonaws.synthetics#RoleArn": {
22762305
"type": "string",
22772306
"traits": {

0 commit comments

Comments
 (0)