diff --git a/clients/client-synthetics/src/commands/CreateCanaryCommand.ts b/clients/client-synthetics/src/commands/CreateCanaryCommand.ts index 8e036950d0c6e..57bd4725b8f3e 100644 --- a/clients/client-synthetics/src/commands/CreateCanaryCommand.ts +++ b/clients/client-synthetics/src/commands/CreateCanaryCommand.ts @@ -82,6 +82,9 @@ export interface CreateCanaryCommandOutput extends CreateCanaryResponse, __Metad * "STRING_VALUE", * ], * }, + * ResourcesToReplicateTags: [ // ResourceList + * "lambda-function", + * ], * Tags: { // TagMap * "": "STRING_VALUE", * }, diff --git a/clients/client-synthetics/src/commands/DeleteCanaryCommand.ts b/clients/client-synthetics/src/commands/DeleteCanaryCommand.ts index dbef86be88b97..2247d83485ed6 100644 --- a/clients/client-synthetics/src/commands/DeleteCanaryCommand.ts +++ b/clients/client-synthetics/src/commands/DeleteCanaryCommand.ts @@ -38,8 +38,9 @@ export interface DeleteCanaryCommandOutput extends DeleteCanaryResponse, __Metad * *

Before you delete a canary, you might want to use GetCanary to display diff --git a/clients/client-synthetics/src/models/models_0.ts b/clients/client-synthetics/src/models/models_0.ts index 2bd176b6ded7a..b5014bbaf62a7 100644 --- a/clients/client-synthetics/src/models/models_0.ts +++ b/clients/client-synthetics/src/models/models_0.ts @@ -736,6 +736,23 @@ export interface CanaryLastRun { * script is stored in an S3 bucket, the bucket name, key, and version are also included. If * the script was passed into the canary directly, the script code is contained in the value * of Zipfile.

+ *

If you are uploading your canary scripts with an Amazon S3 bucket, your zip file should include your + * script in a certain folder structure.

+ * * @public */ export interface CanaryCodeInput { @@ -872,6 +889,19 @@ export interface CanaryScheduleInput { DurationInSeconds?: number; } +/** + * @public + * @enum + */ +export const ResourceToTag = { + LAMBDA_FUNCTION: "lambda-function", +} as const; + +/** + * @public + */ +export type ResourceToTag = (typeof ResourceToTag)[keyof typeof ResourceToTag]; + /** *

If this canary is to test an endpoint in a VPC, this structure contains * information about the subnets and security groups of the VPC endpoint. @@ -1020,6 +1050,15 @@ export interface CreateCanaryRequest { */ VpcConfig?: VpcConfigInput; + /** + *

To have the tags that you apply to this canary also be applied to the Lambda function that + * the canary uses, specify this parameter with the value lambda-function.

+ *

If you specify this parameter and don't specify any tags in the Tags + * parameter, the canary creation fails.

+ * @public + */ + ResourcesToReplicateTags?: ResourceToTag[]; + /** *

A list of key-value pairs to associate with the canary. * You can associate as many as 50 tags with a canary.

@@ -1027,6 +1066,8 @@ export interface CreateCanaryRequest { * resources. You can also use them to scope user permissions, by * granting a user permission to access or change only the resources that have * certain tag values.

+ *

To have the tags that you apply to this canary also be applied to the Lambda function that + * the canary uses, specify this parameter with the value lambda-function.

* @public */ Tags?: Record; @@ -1203,7 +1244,7 @@ export interface DescribeCanariesRequest { /** *

Specify this parameter to limit how many canaries are returned each time you use - * the DescribeCanaries operation. If you omit this parameter, the default of 100 is used.

+ * the DescribeCanaries operation. If you omit this parameter, the default of 20 is used.

* @public */ MaxResults?: number; diff --git a/clients/client-synthetics/src/protocols/Aws_restJson1.ts b/clients/client-synthetics/src/protocols/Aws_restJson1.ts index 595a532422219..ea0b17836f8c9 100644 --- a/clients/client-synthetics/src/protocols/Aws_restJson1.ts +++ b/clients/client-synthetics/src/protocols/Aws_restJson1.ts @@ -79,6 +79,7 @@ import { NotFoundException, RequestEntityTooLargeException, ResourceNotFoundException, + ResourceToTag, RuntimeVersion, S3EncryptionConfig, ServiceQuotaExceededException, @@ -133,6 +134,7 @@ export const se_CreateCanaryCommand = async ( ExecutionRoleArn: [], FailureRetentionPeriodInDays: [], Name: [], + ResourcesToReplicateTags: (_) => _json(_), RunConfig: (_) => _json(_), RuntimeVersion: [], Schedule: (_) => _json(_), @@ -1232,6 +1234,8 @@ const se_CanaryCodeInput = (input: CanaryCodeInput, context: __SerdeContext): an // se_EnvironmentVariablesMap omitted. +// se_ResourceList omitted. + // se_S3EncryptionConfig omitted. // se_SecurityGroupIds omitted. diff --git a/codegen/sdk-codegen/aws-models/synthetics.json b/codegen/sdk-codegen/aws-models/synthetics.json index 000134f74b4dd..924074ae5c49b 100644 --- a/codegen/sdk-codegen/aws-models/synthetics.json +++ b/codegen/sdk-codegen/aws-models/synthetics.json @@ -308,7 +308,7 @@ "min": 1, "max": 2048 }, - "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}$" + "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}$" } }, "com.amazonaws.synthetics#CanaryCodeInput": { @@ -347,7 +347,7 @@ } }, "traits": { - "smithy.api#documentation": "

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 Zipfile.

" + "smithy.api#documentation": "

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 Zipfile.

\n

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.

\n " } }, "com.amazonaws.synthetics#CanaryCodeOutput": { @@ -395,7 +395,7 @@ "traits": { "smithy.api#length": { "min": 1, - "max": 21 + "max": 255 }, "smithy.api#pattern": "^[0-9a-z_\\-]+$" } @@ -943,10 +943,16 @@ "smithy.api#documentation": "

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 \n Running a Canary in a VPC.

" } }, + "ResourcesToReplicateTags": { + "target": "com.amazonaws.synthetics#ResourceList", + "traits": { + "smithy.api#documentation": "

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 lambda-function.

\n

If you specify this parameter and don't specify any tags in the Tags\n parameter, the canary creation fails.

" + } + }, "Tags": { "target": "com.amazonaws.synthetics#TagMap", "traits": { - "smithy.api#documentation": "

A list of key-value pairs to associate with the canary. \n You can associate as many as 50 tags with a canary.

\n

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.

" + "smithy.api#documentation": "

A list of key-value pairs to associate with the canary. \n You can associate as many as 50 tags with a canary.

\n

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.

\n

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 lambda-function.

" } }, "ArtifactConfig": { @@ -1063,7 +1069,7 @@ } ], "traits": { - "smithy.api#documentation": "

Permanently deletes the specified canary.

\n

If you specify DeleteLambda to true, CloudWatch Synthetics also deletes\n the Lambda functions and layers that are used by the canary.

\n

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:

\n \n

Before you delete a canary, you might want to use GetCanary 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.

", + "smithy.api#documentation": "

Permanently deletes the specified canary.

\n

If you specify DeleteLambda to true, CloudWatch Synthetics also deletes\n the Lambda functions and layers that are used by the canary.

\n

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:

\n \n

Before you delete a canary, you might want to use GetCanary 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.

", "smithy.api#http": { "method": "DELETE", "uri": "/canary/{Name}", @@ -1298,7 +1304,7 @@ "MaxResults": { "target": "com.amazonaws.synthetics#MaxCanaryResults", "traits": { - "smithy.api#documentation": "

Specify this parameter to limit how many canaries are returned each time you use\n the DescribeCanaries operation. If you omit this parameter, the default of 100 is used.

" + "smithy.api#documentation": "

Specify this parameter to limit how many canaries are returned each time you use\n the DescribeCanaries operation. If you omit this parameter, the default of 20 is used.

" } }, "Names": { @@ -2259,6 +2265,18 @@ "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_\\-]+$" } }, + "com.amazonaws.synthetics#ResourceList": { + "type": "list", + "member": { + "target": "com.amazonaws.synthetics#ResourceToTag" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1 + } + } + }, "com.amazonaws.synthetics#ResourceNotFoundException": { "type": "structure", "members": { @@ -2272,6 +2290,17 @@ "smithy.api#httpError": 404 } }, + "com.amazonaws.synthetics#ResourceToTag": { + "type": "enum", + "members": { + "LAMBDA_FUNCTION": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "lambda-function" + } + } + } + }, "com.amazonaws.synthetics#RoleArn": { "type": "string", "traits": {