From ab843b8d6e9e96e5a5da7bc6e7253b580d05e3c6 Mon Sep 17 00:00:00 2001 From: awstools Date: Fri, 20 Sep 2024 18:17:08 +0000 Subject: [PATCH] feat(clients): update command documentation examples as of 2024-09-20 --- .../AddLayerVersionPermissionCommand.ts | 21 ++++++ .../src/commands/AddPermissionCommand.ts | 40 +++++++++++ .../src/commands/CreateAliasCommand.ts | 23 +++++++ .../CreateEventSourceMappingCommand.ts | 24 +++++++ .../src/commands/CreateFunctionCommand.ts | 64 ++++++++++++++++++ .../src/commands/DeleteAliasCommand.ts | 12 ++++ .../DeleteEventSourceMappingCommand.ts | 22 ++++++ .../src/commands/DeleteFunctionCommand.ts | 12 ++++ .../DeleteFunctionConcurrencyCommand.ts | 11 +++ .../DeleteFunctionEventInvokeConfigCommand.ts | 12 ++++ .../src/commands/DeleteLayerVersionCommand.ts | 12 ++++ ...leteProvisionedConcurrencyConfigCommand.ts | 12 ++++ .../src/commands/GetAccountSettingsCommand.ts | 24 +++++++ .../src/commands/GetAliasCommand.ts | 21 ++++++ .../commands/GetEventSourceMappingCommand.ts | 27 ++++++++ .../src/commands/GetFunctionCommand.ts | 50 ++++++++++++++ .../commands/GetFunctionConcurrencyCommand.ts | 16 +++++ .../GetFunctionConfigurationCommand.ts | 41 ++++++++++++ .../GetFunctionEventInvokeConfigCommand.ts | 26 +++++++ .../commands/GetLayerVersionByArnCommand.ts | 28 ++++++++ .../src/commands/GetLayerVersionCommand.ts | 31 +++++++++ .../src/commands/GetPolicyCommand.ts | 18 +++++ .../GetProvisionedConcurrencyConfigCommand.ts | 42 ++++++++++++ .../src/commands/InvokeAsyncCommand.ts | 17 +++++ .../src/commands/InvokeCommand.ts | 39 +++++++++++ .../src/commands/ListAliasesCommand.ts | 36 ++++++++++ .../ListEventSourceMappingsCommand.ts | 26 +++++++ .../ListFunctionEventInvokeConfigsCommand.ts | 29 ++++++++ .../src/commands/ListFunctionsCommand.ts | 57 ++++++++++++++++ .../src/commands/ListLayerVersionsCommand.ts | 35 ++++++++++ .../src/commands/ListLayersCommand.ts | 31 +++++++++ ...istProvisionedConcurrencyConfigsCommand.ts | 33 +++++++++ .../src/commands/ListTagsCommand.ts | 19 ++++++ .../commands/ListVersionsByFunctionCommand.ts | 67 +++++++++++++++++++ .../commands/PublishLayerVersionCommand.ts | 40 +++++++++++ .../src/commands/PublishVersionCommand.ts | 42 ++++++++++++ .../commands/PutFunctionConcurrencyCommand.ts | 17 +++++ .../PutFunctionEventInvokeConfigCommand.ts | 25 +++++++ .../PutProvisionedConcurrencyConfigCommand.ts | 21 ++++++ .../RemoveLayerVersionPermissionCommand.ts | 13 ++++ .../src/commands/RemovePermissionCommand.ts | 13 ++++ .../src/commands/TagResourceCommand.ts | 14 ++++ .../src/commands/UntagResourceCommand.ts | 14 ++++ .../src/commands/UpdateAliasCommand.ts | 32 +++++++++ .../UpdateEventSourceMappingCommand.ts | 26 +++++++ .../src/commands/UpdateFunctionCodeCommand.ts | 33 +++++++++ .../UpdateFunctionConfigurationCommand.ts | 32 +++++++++ .../UpdateFunctionEventInvokeConfigCommand.ts | 30 +++++++++ 48 files changed, 1330 insertions(+) diff --git a/clients/client-lambda/src/commands/AddLayerVersionPermissionCommand.ts b/clients/client-lambda/src/commands/AddLayerVersionPermissionCommand.ts index 583385180a5b..88d38f359f1c 100644 --- a/clients/client-lambda/src/commands/AddLayerVersionPermissionCommand.ts +++ b/clients/client-lambda/src/commands/AddLayerVersionPermissionCommand.ts @@ -99,6 +99,27 @@ export interface AddLayerVersionPermissionCommandOutput extends AddLayerVersionP *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To add permissions to a layer version + * ```javascript + * // The following example grants permission for the account 223456789012 to use version 1 of a layer named my-layer. + * const input = { + * "Action": "lambda:GetLayerVersion", + * "LayerName": "my-layer", + * "Principal": "223456789012", + * "StatementId": "xaccount", + * "VersionNumber": 1 + * }; + * const command = new AddLayerVersionPermissionCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "RevisionId": "35d87451-f796-4a3f-a618-95a3671b0a0c", + * "Statement": "{\"Sid\":\"xaccount\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::223456789012:root\"},\"Action\":\"lambda:GetLayerVersion\",\"Resource\":\"arn:aws:lambda:us-east-2:123456789012:layer:my-layer:1\"}" + * } + * *\/ + * // example id: to-add-permissions-to-a-layer-version-1586479797163 + * ``` + * */ export class AddLayerVersionPermissionCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/AddPermissionCommand.ts b/clients/client-lambda/src/commands/AddPermissionCommand.ts index 1e3b0730c46f..48fd8f4d08ab 100644 --- a/clients/client-lambda/src/commands/AddPermissionCommand.ts +++ b/clients/client-lambda/src/commands/AddPermissionCommand.ts @@ -114,6 +114,46 @@ export interface AddPermissionCommandOutput extends AddPermissionResponse, __Met *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To grant Amazon S3 permission to invoke a function + * ```javascript + * // The following example adds permission for Amazon S3 to invoke a Lambda function named my-function for notifications from a bucket named my-bucket-1xpuxmplzrlbh in account 123456789012. + * const input = { + * "Action": "lambda:InvokeFunction", + * "FunctionName": "my-function", + * "Principal": "s3.amazonaws.com", + * "SourceAccount": "123456789012", + * "SourceArn": "arn:aws:s3:::my-bucket-1xpuxmplzrlbh/*", + * "StatementId": "s3" + * }; + * const command = new AddPermissionCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "Statement": "{\"Sid\":\"s3\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"s3.amazonaws.com\"},\"Action\":\"lambda:InvokeFunction\",\"Resource\":\"arn:aws:lambda:us-east-2:123456789012:function:my-function\",\"Condition\":{\"StringEquals\":{\"AWS:SourceAccount\":\"123456789012\"},\"ArnLike\":{\"AWS:SourceArn\":\"arn:aws:s3:::my-bucket-1xpuxmplzrlbh\"}}}" + * } + * *\/ + * // example id: add-permission-1474651469455 + * ``` + * + * @example To grant another account permission to invoke a function + * ```javascript + * // The following example adds permission for account 223456789012 invoke a Lambda function named my-function. + * const input = { + * "Action": "lambda:InvokeFunction", + * "FunctionName": "my-function", + * "Principal": "223456789012", + * "StatementId": "xaccount" + * }; + * const command = new AddPermissionCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "Statement": "{\"Sid\":\"xaccount\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::223456789012:root\"},\"Action\":\"lambda:InvokeFunction\",\"Resource\":\"arn:aws:lambda:us-east-2:123456789012:function:my-function\"}" + * } + * *\/ + * // example id: add-permission-1474651469456 + * ``` + * */ export class AddPermissionCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/CreateAliasCommand.ts b/clients/client-lambda/src/commands/CreateAliasCommand.ts index 1c0cfa3ec2ff..bfdc2cf01287 100644 --- a/clients/client-lambda/src/commands/CreateAliasCommand.ts +++ b/clients/client-lambda/src/commands/CreateAliasCommand.ts @@ -93,6 +93,29 @@ export interface CreateAliasCommandOutput extends AliasConfiguration, __Metadata *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To create an alias for a Lambda function + * ```javascript + * // The following example creates an alias named LIVE that points to version 1 of the my-function Lambda function. + * const input = { + * "Description": "alias for live version of function", + * "FunctionName": "my-function", + * "FunctionVersion": "1", + * "Name": "LIVE" + * }; + * const command = new CreateAliasCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "AliasArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function:LIVE", + * "Description": "alias for live version of function", + * "FunctionVersion": "1", + * "Name": "LIVE", + * "RevisionId": "873282ed-xmpl-4dc8-a069-d0c647e470c6" + * } + * *\/ + * // example id: to-create-an-alias-for-a-lambda-function-1586480324259 + * ``` + * */ export class CreateAliasCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/CreateEventSourceMappingCommand.ts b/clients/client-lambda/src/commands/CreateEventSourceMappingCommand.ts index 21114d2328b6..c5fd4729860f 100644 --- a/clients/client-lambda/src/commands/CreateEventSourceMappingCommand.ts +++ b/clients/client-lambda/src/commands/CreateEventSourceMappingCommand.ts @@ -322,6 +322,30 @@ export interface CreateEventSourceMappingCommandOutput extends EventSourceMappin *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To create a mapping between an event source and an AWS Lambda function + * ```javascript + * // The following example creates a mapping between an SQS queue and the my-function Lambda function. + * const input = { + * "BatchSize": 5, + * "EventSourceArn": "arn:aws:sqs:us-west-2:123456789012:my-queue", + * "FunctionName": "my-function" + * }; + * const command = new CreateEventSourceMappingCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "BatchSize": 5, + * "EventSourceArn": "arn:aws:sqs:us-west-2:123456789012:my-queue", + * "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function", + * "LastModified": 1569284520.333, + * "State": "Creating", + * "StateTransitionReason": "USER_INITIATED", + * "UUID": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE" + * } + * *\/ + * // example id: to-create-a-mapping-between-an-event-source-and-an-aws-lambda-function-1586480555467 + * ``` + * */ export class CreateEventSourceMappingCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/CreateFunctionCommand.ts b/clients/client-lambda/src/commands/CreateFunctionCommand.ts index 8a1b149e1720..b4244296cf76 100644 --- a/clients/client-lambda/src/commands/CreateFunctionCommand.ts +++ b/clients/client-lambda/src/commands/CreateFunctionCommand.ts @@ -300,6 +300,70 @@ export interface CreateFunctionCommandOutput extends FunctionConfiguration, __Me *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To create a function + * ```javascript + * // The following example creates a function with a deployment package in Amazon S3 and enables X-Ray tracing and environment variable encryption. + * const input = { + * "Code": { + * "S3Bucket": "my-bucket-1xpuxmplzrlbh", + * "S3Key": "function.zip" + * }, + * "Description": "Process image objects from Amazon S3.", + * "Environment": { + * "Variables": { + * "BUCKET": "my-bucket-1xpuxmplzrlbh", + * "PREFIX": "inbound" + * } + * }, + * "FunctionName": "my-function", + * "Handler": "index.handler", + * "KMSKeyArn": "arn:aws:kms:us-west-2:123456789012:key/b0844d6c-xmpl-4463-97a4-d49f50839966", + * "MemorySize": 256, + * "Publish": true, + * "Role": "arn:aws:iam::123456789012:role/lambda-role", + * "Runtime": "nodejs12.x", + * "Tags": { + * "DEPARTMENT": "Assets" + * }, + * "Timeout": 15, + * "TracingConfig": { + * "Mode": "Active" + * } + * }; + * const command = new CreateFunctionCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "CodeSha256": "YFgDgEKG3ugvF1+pX64gV6tu9qNuIYNUdgJm8nCxsm4=", + * "CodeSize": 5797206, + * "Description": "Process image objects from Amazon S3.", + * "Environment": { + * "Variables": { + * "BUCKET": "my-bucket-1xpuxmplzrlbh", + * "PREFIX": "inbound" + * } + * }, + * "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function", + * "FunctionName": "my-function", + * "Handler": "index.handler", + * "KMSKeyArn": "arn:aws:kms:us-west-2:123456789012:key/b0844d6c-xmpl-4463-97a4-d49f50839966", + * "LastModified": "2020-04-10T19:06:32.563+0000", + * "LastUpdateStatus": "Successful", + * "MemorySize": 256, + * "RevisionId": "b75dcd81-xmpl-48a8-a75a-93ba8b5b9727", + * "Role": "arn:aws:iam::123456789012:role/lambda-role", + * "Runtime": "nodejs12.x", + * "State": "Active", + * "Timeout": 15, + * "TracingConfig": { + * "Mode": "Active" + * }, + * "Version": "1" + * } + * *\/ + * // example id: to-create-a-function-1586492061186 + * ``` + * */ export class CreateFunctionCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/DeleteAliasCommand.ts b/clients/client-lambda/src/commands/DeleteAliasCommand.ts index e944d2956cbb..228b6f7e2538 100644 --- a/clients/client-lambda/src/commands/DeleteAliasCommand.ts +++ b/clients/client-lambda/src/commands/DeleteAliasCommand.ts @@ -67,6 +67,18 @@ export interface DeleteAliasCommandOutput extends __MetadataBearer {} *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To delete a Lambda function alias + * ```javascript + * // The following example deletes an alias named BLUE from a function named my-function + * const input = { + * "FunctionName": "my-function", + * "Name": "BLUE" + * }; + * const command = new DeleteAliasCommand(input); + * await client.send(command); + * // example id: to-delete-a-lambda-function-alias-1481660370804 + * ``` + * */ export class DeleteAliasCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/DeleteEventSourceMappingCommand.ts b/clients/client-lambda/src/commands/DeleteEventSourceMappingCommand.ts index 21ae81478fff..55cc0facf16f 100644 --- a/clients/client-lambda/src/commands/DeleteEventSourceMappingCommand.ts +++ b/clients/client-lambda/src/commands/DeleteEventSourceMappingCommand.ts @@ -150,6 +150,28 @@ export interface DeleteEventSourceMappingCommandOutput extends EventSourceMappin *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To delete a Lambda function event source mapping + * ```javascript + * // The following example deletes an event source mapping. To get a mapping's UUID, use ListEventSourceMappings. + * const input = { + * "UUID": "14e0db71-xmpl-4eb5-b481-8945cf9d10c2" + * }; + * const command = new DeleteEventSourceMappingCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "BatchSize": 5, + * "EventSourceArn": "arn:aws:sqs:us-west-2:123456789012:my-queue", + * "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", + * "LastModified": "${timestamp}", + * "State": "Enabled", + * "StateTransitionReason": "USER_INITIATED", + * "UUID": "14e0db71-xmpl-4eb5-b481-8945cf9d10c2" + * } + * *\/ + * // example id: to-delete-a-lambda-function-event-source-mapping-1481658973862 + * ``` + * */ export class DeleteEventSourceMappingCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/DeleteFunctionCommand.ts b/clients/client-lambda/src/commands/DeleteFunctionCommand.ts index 79572e2ba6ed..7fc97514aa2e 100644 --- a/clients/client-lambda/src/commands/DeleteFunctionCommand.ts +++ b/clients/client-lambda/src/commands/DeleteFunctionCommand.ts @@ -74,6 +74,18 @@ export interface DeleteFunctionCommandOutput extends __MetadataBearer {} *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To delete a version of a Lambda function + * ```javascript + * // The following example deletes version 1 of a Lambda function named my-function. + * const input = { + * "FunctionName": "my-function", + * "Qualifier": "1" + * }; + * const command = new DeleteFunctionCommand(input); + * await client.send(command); + * // example id: to-delete-a-lambda-function-1481648553696 + * ``` + * */ export class DeleteFunctionCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/DeleteFunctionConcurrencyCommand.ts b/clients/client-lambda/src/commands/DeleteFunctionConcurrencyCommand.ts index af91659bd932..512df50ac136 100644 --- a/clients/client-lambda/src/commands/DeleteFunctionConcurrencyCommand.ts +++ b/clients/client-lambda/src/commands/DeleteFunctionConcurrencyCommand.ts @@ -69,6 +69,17 @@ export interface DeleteFunctionConcurrencyCommandOutput extends __MetadataBearer *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To remove the reserved concurrent execution limit from a function + * ```javascript + * // The following example deletes the reserved concurrent execution limit from a function named my-function. + * const input = { + * "FunctionName": "my-function" + * }; + * const command = new DeleteFunctionConcurrencyCommand(input); + * await client.send(command); + * // example id: to-remove-the-reserved-concurrent-execution-limit-from-a-function-1586480714680 + * ``` + * */ export class DeleteFunctionConcurrencyCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/DeleteFunctionEventInvokeConfigCommand.ts b/clients/client-lambda/src/commands/DeleteFunctionEventInvokeConfigCommand.ts index 445a4a662ffd..253b7e976c83 100644 --- a/clients/client-lambda/src/commands/DeleteFunctionEventInvokeConfigCommand.ts +++ b/clients/client-lambda/src/commands/DeleteFunctionEventInvokeConfigCommand.ts @@ -74,6 +74,18 @@ export interface DeleteFunctionEventInvokeConfigCommandOutput extends __Metadata *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To delete an asynchronous invocation configuration + * ```javascript + * // The following example deletes the asynchronous invocation configuration for the GREEN alias of a function named my-function. + * const input = { + * "FunctionName": "my-function", + * "Qualifier": "GREEN" + * }; + * const command = new DeleteFunctionEventInvokeConfigCommand(input); + * await client.send(command); + * // example id: to-delete-an-asynchronous-invocation-configuration-1586481102187 + * ``` + * */ export class DeleteFunctionEventInvokeConfigCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/DeleteLayerVersionCommand.ts b/clients/client-lambda/src/commands/DeleteLayerVersionCommand.ts index 4c3b89469088..8de89cd75568 100644 --- a/clients/client-lambda/src/commands/DeleteLayerVersionCommand.ts +++ b/clients/client-lambda/src/commands/DeleteLayerVersionCommand.ts @@ -63,6 +63,18 @@ export interface DeleteLayerVersionCommandOutput extends __MetadataBearer {} *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To delete a version of a Lambda layer + * ```javascript + * // The following example deletes version 2 of a layer named my-layer. + * const input = { + * "LayerName": "my-layer", + * "VersionNumber": 2 + * }; + * const command = new DeleteLayerVersionCommand(input); + * await client.send(command); + * // example id: to-delete-a-version-of-a-lambda-layer-1586481157547 + * ``` + * */ export class DeleteLayerVersionCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/DeleteProvisionedConcurrencyConfigCommand.ts b/clients/client-lambda/src/commands/DeleteProvisionedConcurrencyConfigCommand.ts index ee78d14496d1..ff4587864250 100644 --- a/clients/client-lambda/src/commands/DeleteProvisionedConcurrencyConfigCommand.ts +++ b/clients/client-lambda/src/commands/DeleteProvisionedConcurrencyConfigCommand.ts @@ -73,6 +73,18 @@ export interface DeleteProvisionedConcurrencyConfigCommandOutput extends __Metad *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To delete a provisioned concurrency configuration + * ```javascript + * // The following example deletes the provisioned concurrency configuration for the GREEN alias of a function named my-function. + * const input = { + * "FunctionName": "my-function", + * "Qualifier": "GREEN" + * }; + * const command = new DeleteProvisionedConcurrencyConfigCommand(input); + * await client.send(command); + * // example id: to-delete-a-provisioned-concurrency-configuration-1586481032551 + * ``` + * */ export class DeleteProvisionedConcurrencyConfigCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/GetAccountSettingsCommand.ts b/clients/client-lambda/src/commands/GetAccountSettingsCommand.ts index 1e1198fc6142..782b81120329 100644 --- a/clients/client-lambda/src/commands/GetAccountSettingsCommand.ts +++ b/clients/client-lambda/src/commands/GetAccountSettingsCommand.ts @@ -70,6 +70,30 @@ export interface GetAccountSettingsCommandOutput extends GetAccountSettingsRespo *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To get account settings + * ```javascript + * // This operation takes no parameters and returns details about storage and concurrency quotas in the current Region. + * const input = {}; + * const command = new GetAccountSettingsCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "AccountLimit": { + * "CodeSizeUnzipped": 262144000, + * "CodeSizeZipped": 52428800, + * "ConcurrentExecutions": 1000, + * "TotalCodeSize": 80530636800, + * "UnreservedConcurrentExecutions": 1000 + * }, + * "AccountUsage": { + * "FunctionCount": 4, + * "TotalCodeSize": 9426 + * } + * } + * *\/ + * // example id: to-get-account-settings-1481657495274 + * ``` + * */ export class GetAccountSettingsCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/GetAliasCommand.ts b/clients/client-lambda/src/commands/GetAliasCommand.ts index 5c47ea86fe8c..f7b2a149508e 100644 --- a/clients/client-lambda/src/commands/GetAliasCommand.ts +++ b/clients/client-lambda/src/commands/GetAliasCommand.ts @@ -78,6 +78,27 @@ export interface GetAliasCommandOutput extends AliasConfiguration, __MetadataBea *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To get a Lambda function alias + * ```javascript + * // The following example returns details about an alias named BLUE for a function named my-function + * const input = { + * "FunctionName": "my-function", + * "Name": "BLUE" + * }; + * const command = new GetAliasCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "AliasArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function:BLUE", + * "Description": "Production environment BLUE.", + * "FunctionVersion": "3", + * "Name": "BLUE", + * "RevisionId": "594f41fb-xmpl-4c20-95c7-6ca5f2a92c93" + * } + * *\/ + * // example id: to-retrieve-a-lambda-function-alias-1481648742254 + * ``` + * */ export class GetAliasCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/GetEventSourceMappingCommand.ts b/clients/client-lambda/src/commands/GetEventSourceMappingCommand.ts index 7d2caa2950c4..92413077cc55 100644 --- a/clients/client-lambda/src/commands/GetEventSourceMappingCommand.ts +++ b/clients/client-lambda/src/commands/GetEventSourceMappingCommand.ts @@ -141,6 +141,33 @@ export interface GetEventSourceMappingCommandOutput extends EventSourceMappingCo *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To get a Lambda function's event source mapping + * ```javascript + * // The following example returns details about an event source mapping. To get a mapping's UUID, use ListEventSourceMappings. + * const input = { + * "UUID": "14e0db71-xmpl-4eb5-b481-8945cf9d10c2" + * }; + * const command = new GetEventSourceMappingCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "BatchSize": 500, + * "BisectBatchOnFunctionError": false, + * "DestinationConfig": {}, + * "EventSourceArn": "arn:aws:sqs:us-east-2:123456789012:mySQSqueue", + * "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:myFunction", + * "LastModified": "${timestamp}", + * "LastProcessingResult": "No records processed", + * "MaximumRecordAgeInSeconds": 604800, + * "MaximumRetryAttempts": 10000, + * "State": "Creating", + * "StateTransitionReason": "User action", + * "UUID": "14e0db71-xmpl-4eb5-b481-8945cf9d10c2" + * } + * *\/ + * // example id: to-get-a-lambda-functions-event-source-mapping-1481661622799 + * ``` + * */ export class GetEventSourceMappingCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/GetFunctionCommand.ts b/clients/client-lambda/src/commands/GetFunctionCommand.ts index 40a3af0d4668..b19bbd60a1af 100644 --- a/clients/client-lambda/src/commands/GetFunctionCommand.ts +++ b/clients/client-lambda/src/commands/GetFunctionCommand.ts @@ -185,6 +185,56 @@ export interface GetFunctionCommandOutput extends GetFunctionResponse, __Metadat *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To get a Lambda function + * ```javascript + * // The following example returns code and configuration details for version 1 of a function named my-function. + * const input = { + * "FunctionName": "my-function", + * "Qualifier": "1" + * }; + * const command = new GetFunctionCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "Code": { + * "Location": "https://awslambda-us-west-2-tasks.s3.us-west-2.amazonaws.com/snapshots/123456789012/my-function-e7d9d1ed-xmpl-4f79-904a-4b87f2681f30?versionId=sH3TQwBOaUy...", + * "RepositoryType": "S3" + * }, + * "Configuration": { + * "CodeSha256": "YFgDgEKG3ugvF1+pX64gV6tu9qNuIYNUdgJm8nCxsm4=", + * "CodeSize": 5797206, + * "Description": "Process image objects from Amazon S3.", + * "Environment": { + * "Variables": { + * "BUCKET": "my-bucket-1xpuxmplzrlbh", + * "PREFIX": "inbound" + * } + * }, + * "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function", + * "FunctionName": "my-function", + * "Handler": "index.handler", + * "KMSKeyArn": "arn:aws:kms:us-west-2:123456789012:key/b0844d6c-xmpl-4463-97a4-d49f50839966", + * "LastModified": "2020-04-10T19:06:32.563+0000", + * "LastUpdateStatus": "Successful", + * "MemorySize": 256, + * "RevisionId": "b75dcd81-xmpl-48a8-a75a-93ba8b5b9727", + * "Role": "arn:aws:iam::123456789012:role/lambda-role", + * "Runtime": "nodejs12.x", + * "State": "Active", + * "Timeout": 15, + * "TracingConfig": { + * "Mode": "Active" + * }, + * "Version": "$LATEST" + * }, + * "Tags": { + * "DEPARTMENT": "Assets" + * } + * } + * *\/ + * // example id: to-get-a-lambda-function-1481661622799 + * ``` + * */ export class GetFunctionCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/GetFunctionConcurrencyCommand.ts b/clients/client-lambda/src/commands/GetFunctionConcurrencyCommand.ts index d0742d350d83..338213c66453 100644 --- a/clients/client-lambda/src/commands/GetFunctionConcurrencyCommand.ts +++ b/clients/client-lambda/src/commands/GetFunctionConcurrencyCommand.ts @@ -69,6 +69,22 @@ export interface GetFunctionConcurrencyCommandOutput extends GetFunctionConcurre *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To get the reserved concurrency setting for a function + * ```javascript + * // The following example returns the reserved concurrency setting for a function named my-function. + * const input = { + * "FunctionName": "my-function" + * }; + * const command = new GetFunctionConcurrencyCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "ReservedConcurrentExecutions": 250 + * } + * *\/ + * // example id: to-get-the-reserved-concurrency-setting-for-a-function-1586481279992 + * ``` + * */ export class GetFunctionConcurrencyCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/GetFunctionConfigurationCommand.ts b/clients/client-lambda/src/commands/GetFunctionConfigurationCommand.ts index 7a2cc4b01d2c..ee71b1cd0b02 100644 --- a/clients/client-lambda/src/commands/GetFunctionConfigurationCommand.ts +++ b/clients/client-lambda/src/commands/GetFunctionConfigurationCommand.ts @@ -175,6 +175,47 @@ export interface GetFunctionConfigurationCommandOutput extends FunctionConfigura *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To get a Lambda function's event source mapping + * ```javascript + * // The following example returns and configuration details for version 1 of a function named my-function. + * const input = { + * "FunctionName": "my-function", + * "Qualifier": "1" + * }; + * const command = new GetFunctionConfigurationCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "CodeSha256": "YFgDgEKG3ugvF1+pX64gV6tu9qNuIYNUdgJm8nCxsm4=", + * "CodeSize": 5797206, + * "Description": "Process image objects from Amazon S3.", + * "Environment": { + * "Variables": { + * "BUCKET": "my-bucket-1xpuxmplzrlbh", + * "PREFIX": "inbound" + * } + * }, + * "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function", + * "FunctionName": "my-function", + * "Handler": "index.handler", + * "KMSKeyArn": "arn:aws:kms:us-west-2:123456789012:key/b0844d6c-xmpl-4463-97a4-d49f50839966", + * "LastModified": "2020-04-10T19:06:32.563+0000", + * "LastUpdateStatus": "Successful", + * "MemorySize": 256, + * "RevisionId": "b75dcd81-xmpl-48a8-a75a-93ba8b5b9727", + * "Role": "arn:aws:iam::123456789012:role/lambda-role", + * "Runtime": "nodejs12.x", + * "State": "Active", + * "Timeout": 15, + * "TracingConfig": { + * "Mode": "Active" + * }, + * "Version": "$LATEST" + * } + * *\/ + * // example id: to-get-a-lambda-functions-event-source-mapping-1481661622799 + * ``` + * */ export class GetFunctionConfigurationCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/GetFunctionEventInvokeConfigCommand.ts b/clients/client-lambda/src/commands/GetFunctionEventInvokeConfigCommand.ts index ef56f604a942..570eaf0298bd 100644 --- a/clients/client-lambda/src/commands/GetFunctionEventInvokeConfigCommand.ts +++ b/clients/client-lambda/src/commands/GetFunctionEventInvokeConfigCommand.ts @@ -84,6 +84,32 @@ export interface GetFunctionEventInvokeConfigCommandOutput extends FunctionEvent *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To get an asynchronous invocation configuration + * ```javascript + * // The following example returns the asynchronous invocation configuration for the BLUE alias of a function named my-function. + * const input = { + * "FunctionName": "my-function", + * "Qualifier": "BLUE" + * }; + * const command = new GetFunctionEventInvokeConfigCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "DestinationConfig": { + * "OnFailure": { + * "Destination": "arn:aws:sqs:us-east-2:123456789012:failed-invocations" + * }, + * "OnSuccess": {} + * }, + * "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function:BLUE", + * "LastModified": "${timestamp}", + * "MaximumEventAgeInSeconds": 3600, + * "MaximumRetryAttempts": 0 + * } + * *\/ + * // example id: to-get-an-asynchronous-invocation-configuration-1586481338463 + * ``` + * */ export class GetFunctionEventInvokeConfigCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/GetLayerVersionByArnCommand.ts b/clients/client-lambda/src/commands/GetLayerVersionByArnCommand.ts index 5fa976191975..43314e2f97fc 100644 --- a/clients/client-lambda/src/commands/GetLayerVersionByArnCommand.ts +++ b/clients/client-lambda/src/commands/GetLayerVersionByArnCommand.ts @@ -88,6 +88,34 @@ export interface GetLayerVersionByArnCommandOutput extends GetLayerVersionRespon *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To get information about a Lambda layer version + * ```javascript + * // The following example returns information about the layer version with the specified Amazon Resource Name (ARN). + * const input = { + * "Arn": "arn:aws:lambda:ca-central-1:123456789012:layer:blank-python-lib:3" + * }; + * const command = new GetLayerVersionByArnCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "CompatibleRuntimes": [ + * "python3.8" + * ], + * "Content": { + * "CodeSha256": "6x+xmpl/M3BnQUk7gS9sGmfeFsR/npojXoA3fZUv4eU=", + * "CodeSize": 9529009, + * "Location": "https://awslambda-us-east-2-layers.s3.us-east-2.amazonaws.com/snapshots/123456789012/blank-python-lib-e5212378-xmpl-44ee-8398-9d8ec5113949?versionId=WbZnvf..." + * }, + * "CreatedDate": "2020-03-31T00:35:18.949+0000", + * "Description": "Dependencies for the blank-python sample app.", + * "LayerArn": "arn:aws:lambda:us-east-2:123456789012:layer:blank-python-lib", + * "LayerVersionArn": "arn:aws:lambda:us-east-2:123456789012:layer:blank-python-lib:3", + * "Version": 3 + * } + * *\/ + * // example id: to-get-information-about-a-lambda-layer-version-1586481457839 + * ``` + * */ export class GetLayerVersionByArnCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/GetLayerVersionCommand.ts b/clients/client-lambda/src/commands/GetLayerVersionCommand.ts index 7e24eaafb82c..7cd28befbd48 100644 --- a/clients/client-lambda/src/commands/GetLayerVersionCommand.ts +++ b/clients/client-lambda/src/commands/GetLayerVersionCommand.ts @@ -89,6 +89,37 @@ export interface GetLayerVersionCommandOutput extends GetLayerVersionResponse, _ *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To get information about a Lambda layer version + * ```javascript + * // The following example returns information for version 1 of a layer named my-layer. + * const input = { + * "LayerName": "my-layer", + * "VersionNumber": 1 + * }; + * const command = new GetLayerVersionCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "CompatibleRuntimes": [ + * "python3.6", + * "python3.7" + * ], + * "Content": { + * "CodeSha256": "tv9jJO+rPbXUUXuRKi7CwHzKtLDkDRJLB3cC3Z/ouXo=", + * "CodeSize": 169, + * "Location": "https://awslambda-us-east-2-layers.s3.us-east-2.amazonaws.com/snapshots/123456789012/my-layer-4aaa2fbb-ff77-4b0a-ad92-5b78a716a96a?versionId=27iWyA73cCAYqyH..." + * }, + * "CreatedDate": "2018-11-14T23:03:52.894+0000", + * "Description": "My Python layer", + * "LayerArn": "arn:aws:lambda:us-east-2:123456789012:layer:my-layer", + * "LayerVersionArn": "arn:aws:lambda:us-east-2:123456789012:layer:my-layer:1", + * "LicenseInfo": "MIT", + * "Version": 1 + * } + * *\/ + * // example id: to-get-information-about-a-lambda-layer-version-1586481457839 + * ``` + * */ export class GetLayerVersionCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/GetPolicyCommand.ts b/clients/client-lambda/src/commands/GetPolicyCommand.ts index 18496f6535b0..9a1e2cdb5563 100644 --- a/clients/client-lambda/src/commands/GetPolicyCommand.ts +++ b/clients/client-lambda/src/commands/GetPolicyCommand.ts @@ -70,6 +70,24 @@ export interface GetPolicyCommandOutput extends GetPolicyResponse, __MetadataBea *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To retrieve a Lambda function policy + * ```javascript + * // The following example returns the resource-based policy for version 1 of a Lambda function named my-function. + * const input = { + * "FunctionName": "my-function", + * "Qualifier": "1" + * }; + * const command = new GetPolicyCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "Policy": "{\"Version\":\"2012-10-17\",\"Id\":\"default\",\"Statement\":[{\"Sid\":\"xaccount\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::123456789012:root\"},\"Action\":\"lambda:InvokeFunction\",\"Resource\":\"arn:aws:lambda:us-east-2:123456789012:function:my-function:1\"}]}", + * "RevisionId": "4843f2f6-7c59-4fda-b484-afd0bc0e22b8" + * } + * *\/ + * // example id: to-retrieve-a-lambda-function-policy-1481649319053 + * ``` + * */ export class GetPolicyCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/GetProvisionedConcurrencyConfigCommand.ts b/clients/client-lambda/src/commands/GetProvisionedConcurrencyConfigCommand.ts index 1272d9d3bd0c..670cc43d90bf 100644 --- a/clients/client-lambda/src/commands/GetProvisionedConcurrencyConfigCommand.ts +++ b/clients/client-lambda/src/commands/GetProvisionedConcurrencyConfigCommand.ts @@ -82,6 +82,48 @@ export interface GetProvisionedConcurrencyConfigCommandOutput *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To view a provisioned concurrency configuration + * ```javascript + * // The following example displays details for the provisioned concurrency configuration for the BLUE alias of the specified function. + * const input = { + * "FunctionName": "my-function", + * "Qualifier": "BLUE" + * }; + * const command = new GetProvisionedConcurrencyConfigCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "AllocatedProvisionedConcurrentExecutions": 100, + * "AvailableProvisionedConcurrentExecutions": 100, + * "LastModified": "2019-12-31T20:28:49+0000", + * "RequestedProvisionedConcurrentExecutions": 100, + * "Status": "READY" + * } + * *\/ + * // example id: to-view-a-provisioned-concurrency-configuration-1586490192690 + * ``` + * + * @example To get a provisioned concurrency configuration + * ```javascript + * // The following example returns details for the provisioned concurrency configuration for the BLUE alias of the specified function. + * const input = { + * "FunctionName": "my-function", + * "Qualifier": "BLUE" + * }; + * const command = new GetProvisionedConcurrencyConfigCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "AllocatedProvisionedConcurrentExecutions": 100, + * "AvailableProvisionedConcurrentExecutions": 100, + * "LastModified": "2019-12-31T20:28:49+0000", + * "RequestedProvisionedConcurrentExecutions": 100, + * "Status": "READY" + * } + * *\/ + * // example id: to-get-a-provisioned-concurrency-configuration-1586490192690 + * ``` + * */ export class GetProvisionedConcurrencyConfigCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/InvokeAsyncCommand.ts b/clients/client-lambda/src/commands/InvokeAsyncCommand.ts index 4b11bfa71ced..d8d0e5376db6 100644 --- a/clients/client-lambda/src/commands/InvokeAsyncCommand.ts +++ b/clients/client-lambda/src/commands/InvokeAsyncCommand.ts @@ -84,6 +84,23 @@ export interface InvokeAsyncCommandOutput extends InvokeAsyncResponse, __Metadat *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To invoke a Lambda function asynchronously + * ```javascript + * // The following example invokes a Lambda function asynchronously + * const input = { + * "FunctionName": "my-function", + * "InvokeArgs": "{}" + * }; + * const command = new InvokeAsyncCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "Status": 202 + * } + * *\/ + * // example id: to-invoke-a-lambda-function-asynchronously-1481649694923 + * ``` + * */ export class InvokeAsyncCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/InvokeCommand.ts b/clients/client-lambda/src/commands/InvokeCommand.ts index 2b947e2807b8..559e31b1fa3a 100644 --- a/clients/client-lambda/src/commands/InvokeCommand.ts +++ b/clients/client-lambda/src/commands/InvokeCommand.ts @@ -215,6 +215,45 @@ export interface InvokeCommandOutput extends InvokeCommandOutputType, __Metadata *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To invoke a Lambda function + * ```javascript + * // The following example invokes version 1 of a function named my-function with an empty event payload. + * const input = { + * "FunctionName": "my-function", + * "Payload": "{}", + * "Qualifier": "1" + * }; + * const command = new InvokeCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "Payload": "200 SUCCESS", + * "StatusCode": 200 + * } + * *\/ + * // example id: to-invoke-a-lambda-function-1481659683915 + * ``` + * + * @example To invoke a Lambda function asynchronously + * ```javascript + * // The following example invokes version 1 of a function named my-function asynchronously. + * const input = { + * "FunctionName": "my-function", + * "InvocationType": "Event", + * "Payload": "{}", + * "Qualifier": "1" + * }; + * const command = new InvokeCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "Payload": "", + * "StatusCode": 202 + * } + * *\/ + * // example id: to-invoke-a-lambda-function-async-1481659683915 + * ``` + * */ export class InvokeCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/ListAliasesCommand.ts b/clients/client-lambda/src/commands/ListAliasesCommand.ts index d5dd3fe5332f..b800a86c7c27 100644 --- a/clients/client-lambda/src/commands/ListAliasesCommand.ts +++ b/clients/client-lambda/src/commands/ListAliasesCommand.ts @@ -86,6 +86,42 @@ export interface ListAliasesCommandOutput extends ListAliasesResponse, __Metadat *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To list a function's aliases + * ```javascript + * // The following example returns a list of aliases for a function named my-function. + * const input = { + * "FunctionName": "my-function" + * }; + * const command = new ListAliasesCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "Aliases": [ + * { + * "AliasArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function:BETA", + * "Description": "Production environment BLUE.", + * "FunctionVersion": "2", + * "Name": "BLUE", + * "RevisionId": "a410117f-xmpl-494e-8035-7e204bb7933b", + * "RoutingConfig": { + * "AdditionalVersionWeights": { + * "1": 0.7 + * } + * } + * }, + * { + * "AliasArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function:LIVE", + * "Description": "Production environment GREEN.", + * "FunctionVersion": "1", + * "Name": "GREEN", + * "RevisionId": "21d40116-xmpl-40ba-9360-3ea284da1bb5" + * } + * ] + * } + * *\/ + * // example id: to-list-a-functions-aliases-1481650199732 + * ``` + * */ export class ListAliasesCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/ListEventSourceMappingsCommand.ts b/clients/client-lambda/src/commands/ListEventSourceMappingsCommand.ts index 804cd2f31411..c870d71aad22 100644 --- a/clients/client-lambda/src/commands/ListEventSourceMappingsCommand.ts +++ b/clients/client-lambda/src/commands/ListEventSourceMappingsCommand.ts @@ -149,6 +149,32 @@ export interface ListEventSourceMappingsCommandOutput extends ListEventSourceMap *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To list the event source mappings for a function + * ```javascript + * // The following example returns a list of the event source mappings for a function named my-function. + * const input = { + * "FunctionName": "my-function" + * }; + * const command = new ListEventSourceMappingsCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "EventSourceMappings": [ + * { + * "BatchSize": 5, + * "EventSourceArn": "arn:aws:sqs:us-west-2:123456789012:mySQSqueue", + * "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function", + * "LastModified": 1569284520.333, + * "State": "Enabled", + * "StateTransitionReason": "USER_INITIATED", + * "UUID": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE" + * } + * ] + * } + * *\/ + * // example id: to-list-the-event-source-mappings-for-a-function-1586490285906 + * ``` + * */ export class ListEventSourceMappingsCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/ListFunctionEventInvokeConfigsCommand.ts b/clients/client-lambda/src/commands/ListFunctionEventInvokeConfigsCommand.ts index 068893fbb987..af066dd461d3 100644 --- a/clients/client-lambda/src/commands/ListFunctionEventInvokeConfigsCommand.ts +++ b/clients/client-lambda/src/commands/ListFunctionEventInvokeConfigsCommand.ts @@ -92,6 +92,35 @@ export interface ListFunctionEventInvokeConfigsCommandOutput *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To view a list of asynchronous invocation configurations + * ```javascript + * // The following example returns a list of asynchronous invocation configurations for a function named my-function. + * const input = { + * "FunctionName": "my-function" + * }; + * const command = new ListFunctionEventInvokeConfigsCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "FunctionEventInvokeConfigs": [ + * { + * "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function:GREEN", + * "LastModified": 1577824406.719, + * "MaximumEventAgeInSeconds": 1800, + * "MaximumRetryAttempts": 2 + * }, + * { + * "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function:BLUE", + * "LastModified": 1577824396.653, + * "MaximumEventAgeInSeconds": 3600, + * "MaximumRetryAttempts": 0 + * } + * ] + * } + * *\/ + * // example id: to-view-a-list-of-asynchronous-invocation-configurations-1586490355611 + * ``` + * */ export class ListFunctionEventInvokeConfigsCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/ListFunctionsCommand.ts b/clients/client-lambda/src/commands/ListFunctionsCommand.ts index 019b95a049a3..492e103486d1 100644 --- a/clients/client-lambda/src/commands/ListFunctionsCommand.ts +++ b/clients/client-lambda/src/commands/ListFunctionsCommand.ts @@ -185,6 +185,63 @@ export interface ListFunctionsCommandOutput extends ListFunctionsResponse, __Met *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To get a list of Lambda functions + * ```javascript + * // This operation returns a list of Lambda functions. + * const input = {}; + * const command = new ListFunctionsCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "Functions": [ + * { + * "CodeSha256": "dBG9m8SGdmlEjw/JYXlhhvCrAv5TxvXsbL/RMr0fT/I=", + * "CodeSize": 294, + * "Description": "", + * "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:helloworld", + * "FunctionName": "helloworld", + * "Handler": "helloworld.handler", + * "LastModified": "2019-09-23T18:32:33.857+0000", + * "MemorySize": 128, + * "RevisionId": "1718e831-badf-4253-9518-d0644210af7b", + * "Role": "arn:aws:iam::123456789012:role/service-role/MyTestFunction-role-zgur6bf4", + * "Runtime": "nodejs10.x", + * "Timeout": 3, + * "TracingConfig": { + * "Mode": "PassThrough" + * }, + * "Version": "$LATEST" + * }, + * { + * "CodeSha256": "sU0cJ2/hOZevwV/lTxCuQqK3gDZP3i8gUoqUUVRmY6E=", + * "CodeSize": 266, + * "Description": "", + * "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function", + * "FunctionName": "my-function", + * "Handler": "index.handler", + * "LastModified": "2019-10-01T16:47:28.490+0000", + * "MemorySize": 256, + * "RevisionId": "93017fc9-59cb-41dc-901b-4845ce4bf668", + * "Role": "arn:aws:iam::123456789012:role/service-role/helloWorldPython-role-uy3l9qyq", + * "Runtime": "nodejs10.x", + * "Timeout": 3, + * "TracingConfig": { + * "Mode": "PassThrough" + * }, + * "Version": "$LATEST", + * "VpcConfig": { + * "SecurityGroupIds": [], + * "SubnetIds": [], + * "VpcId": "" + * } + * } + * ], + * "NextMarker": "" + * } + * *\/ + * // example id: to-get-a-list-of-lambda-functions-1481650507425 + * ``` + * */ export class ListFunctionsCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/ListLayerVersionsCommand.ts b/clients/client-lambda/src/commands/ListLayerVersionsCommand.ts index 2bfef9a85b61..f071a9d1cc5f 100644 --- a/clients/client-lambda/src/commands/ListLayerVersionsCommand.ts +++ b/clients/client-lambda/src/commands/ListLayerVersionsCommand.ts @@ -90,6 +90,41 @@ export interface ListLayerVersionsCommandOutput extends ListLayerVersionsRespons *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To list versions of a layer + * ```javascript + * // The following example displays information about the versions for the layer named blank-java-lib + * const input = { + * "LayerName": "blank-java-lib" + * }; + * const command = new ListLayerVersionsCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "LayerVersions": [ + * { + * "CompatibleRuntimes": [ + * "java8" + * ], + * "CreatedDate": "2020-03-18T23:38:42.284+0000", + * "Description": "Dependencies for the blank-java sample app.", + * "LayerVersionArn": "arn:aws:lambda:us-east-2:123456789012:layer:blank-java-lib:7", + * "Version": 7 + * }, + * { + * "CompatibleRuntimes": [ + * "java8" + * ], + * "CreatedDate": "2020-03-17T07:24:21.960+0000", + * "Description": "Dependencies for the blank-java sample app.", + * "LayerVersionArn": "arn:aws:lambda:us-east-2:123456789012:layer:blank-java-lib:6", + * "Version": 6 + * } + * ] + * } + * *\/ + * // example id: to-list-versions-of-a-layer-1586490857297 + * ``` + * */ export class ListLayerVersionsCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/ListLayersCommand.ts b/clients/client-lambda/src/commands/ListLayersCommand.ts index b84fafcd9717..62f5acd29bf7 100644 --- a/clients/client-lambda/src/commands/ListLayersCommand.ts +++ b/clients/client-lambda/src/commands/ListLayersCommand.ts @@ -92,6 +92,37 @@ export interface ListLayersCommandOutput extends ListLayersResponse, __MetadataB *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To list the layers that are compatible with your function's runtime + * ```javascript + * // The following example returns information about layers that are compatible with the Python 3.7 runtime. + * const input = { + * "CompatibleRuntime": "python3.7" + * }; + * const command = new ListLayersCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "Layers": [ + * { + * "LatestMatchingVersion": { + * "CompatibleRuntimes": [ + * "python3.6", + * "python3.7" + * ], + * "CreatedDate": "2018-11-15T00:37:46.592+0000", + * "Description": "My layer", + * "LayerVersionArn": "arn:aws:lambda:us-east-2:123456789012:layer:my-layer:2", + * "Version": 2 + * }, + * "LayerArn": "arn:aws:lambda:us-east-2:123456789012:layer:my-layer", + * "LayerName": "my-layer" + * } + * ] + * } + * *\/ + * // example id: to-list-the-layers-that-are-compatible-with-your-functions-runtime-1586490857297 + * ``` + * */ export class ListLayersCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/ListProvisionedConcurrencyConfigsCommand.ts b/clients/client-lambda/src/commands/ListProvisionedConcurrencyConfigsCommand.ts index e48f2dbf1053..d25cd0116ff6 100644 --- a/clients/client-lambda/src/commands/ListProvisionedConcurrencyConfigsCommand.ts +++ b/clients/client-lambda/src/commands/ListProvisionedConcurrencyConfigsCommand.ts @@ -89,6 +89,39 @@ export interface ListProvisionedConcurrencyConfigsCommandOutput *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To get a list of provisioned concurrency configurations + * ```javascript + * // The following example returns a list of provisioned concurrency configurations for a function named my-function. + * const input = { + * "FunctionName": "my-function" + * }; + * const command = new ListProvisionedConcurrencyConfigsCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "ProvisionedConcurrencyConfigs": [ + * { + * "AllocatedProvisionedConcurrentExecutions": 100, + * "AvailableProvisionedConcurrentExecutions": 100, + * "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function:GREEN", + * "LastModified": "2019-12-31T20:29:00+0000", + * "RequestedProvisionedConcurrentExecutions": 100, + * "Status": "READY" + * }, + * { + * "AllocatedProvisionedConcurrentExecutions": 100, + * "AvailableProvisionedConcurrentExecutions": 100, + * "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function:BLUE", + * "LastModified": "2019-12-31T20:28:49+0000", + * "RequestedProvisionedConcurrentExecutions": 100, + * "Status": "READY" + * } + * ] + * } + * *\/ + * // example id: to-get-a-list-of-provisioned-concurrency-configurations-1586491032592 + * ``` + * */ export class ListProvisionedConcurrencyConfigsCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/ListTagsCommand.ts b/clients/client-lambda/src/commands/ListTagsCommand.ts index 9c64c95fe39c..32df92b7261e 100644 --- a/clients/client-lambda/src/commands/ListTagsCommand.ts +++ b/clients/client-lambda/src/commands/ListTagsCommand.ts @@ -71,6 +71,25 @@ export interface ListTagsCommandOutput extends ListTagsResponse, __MetadataBeare *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To retrieve the list of tags for a Lambda function + * ```javascript + * // The following example displays the tags attached to the my-function Lambda function. + * const input = { + * "Resource": "arn:aws:lambda:us-west-2:123456789012:function:my-function" + * }; + * const command = new ListTagsCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "Tags": { + * "Category": "Web Tools", + * "Department": "Sales" + * } + * } + * *\/ + * // example id: to-retrieve-the-list-of-tags-for-a-lambda-function-1586491111498 + * ``` + * */ export class ListTagsCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/ListVersionsByFunctionCommand.ts b/clients/client-lambda/src/commands/ListVersionsByFunctionCommand.ts index 77ec9790d1a1..29cc2ba8cd2e 100644 --- a/clients/client-lambda/src/commands/ListVersionsByFunctionCommand.ts +++ b/clients/client-lambda/src/commands/ListVersionsByFunctionCommand.ts @@ -180,6 +180,73 @@ export interface ListVersionsByFunctionCommandOutput extends ListVersionsByFunct *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To list versions of a function + * ```javascript + * // The following example returns a list of versions of a function named my-function + * const input = { + * "FunctionName": "my-function" + * }; + * const command = new ListVersionsByFunctionCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "Versions": [ + * { + * "CodeSha256": "YFgDgEKG3ugvF1+pX64gV6tu9qNuIYNUdgJm8nCxsm4=", + * "CodeSize": 5797206, + * "Description": "Process image objects from Amazon S3.", + * "Environment": { + * "Variables": { + * "BUCKET": "my-bucket-1xpuxmplzrlbh", + * "PREFIX": "inbound" + * } + * }, + * "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function", + * "FunctionName": "my-function", + * "Handler": "index.handler", + * "KMSKeyArn": "arn:aws:kms:us-west-2:123456789012:key/b0844d6c-xmpl-4463-97a4-d49f50839966", + * "LastModified": "2020-04-10T19:06:32.563+0000", + * "MemorySize": 256, + * "RevisionId": "850ca006-2d98-4ff4-86db-8766e9d32fe9", + * "Role": "arn:aws:iam::123456789012:role/lambda-role", + * "Runtime": "nodejs12.x", + * "Timeout": 15, + * "TracingConfig": { + * "Mode": "Active" + * }, + * "Version": "$LATEST" + * }, + * { + * "CodeSha256": "YFgDgEKG3ugvF1+pX64gV6tu9qNuIYNUdgJm8nCxsm4=", + * "CodeSize": 5797206, + * "Description": "Process image objects from Amazon S3.", + * "Environment": { + * "Variables": { + * "BUCKET": "my-bucket-1xpuxmplzrlbh", + * "PREFIX": "inbound" + * } + * }, + * "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function", + * "FunctionName": "my-function", + * "Handler": "index.handler", + * "KMSKeyArn": "arn:aws:kms:us-west-2:123456789012:key/b0844d6c-xmpl-4463-97a4-d49f50839966", + * "LastModified": "2020-04-10T19:06:32.563+0000", + * "MemorySize": 256, + * "RevisionId": "b75dcd81-xmpl-48a8-a75a-93ba8b5b9727", + * "Role": "arn:aws:iam::123456789012:role/lambda-role", + * "Runtime": "nodejs12.x", + * "Timeout": 5, + * "TracingConfig": { + * "Mode": "Active" + * }, + * "Version": "1" + * } + * ] + * } + * *\/ + * // example id: to-list-versions-1481650603750 + * ``` + * */ export class ListVersionsByFunctionCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/PublishLayerVersionCommand.ts b/clients/client-lambda/src/commands/PublishLayerVersionCommand.ts index 159da3e2f840..25ec75eb4a5d 100644 --- a/clients/client-lambda/src/commands/PublishLayerVersionCommand.ts +++ b/clients/client-lambda/src/commands/PublishLayerVersionCommand.ts @@ -110,6 +110,46 @@ export interface PublishLayerVersionCommandOutput extends PublishLayerVersionRes *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To create a Lambda layer version + * ```javascript + * // The following example creates a new Python library layer version. The command retrieves the layer content a file named layer.zip in the specified S3 bucket. + * const input = { + * "CompatibleRuntimes": [ + * "python3.6", + * "python3.7" + * ], + * "Content": { + * "S3Bucket": "lambda-layers-us-west-2-123456789012", + * "S3Key": "layer.zip" + * }, + * "Description": "My Python layer", + * "LayerName": "my-layer", + * "LicenseInfo": "MIT" + * }; + * const command = new PublishLayerVersionCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "CompatibleRuntimes": [ + * "python3.6", + * "python3.7" + * ], + * "Content": { + * "CodeSha256": "tv9jJO+rPbXUUXuRKi7CwHzKtLDkDRJLB3cC3Z/ouXo=", + * "CodeSize": 169, + * "Location": "https://awslambda-us-west-2-layers.s3.us-west-2.amazonaws.com/snapshots/123456789012/my-layer-4aaa2fbb-ff77-4b0a-ad92-5b78a716a96a?versionId=27iWyA73cCAYqyH..." + * }, + * "CreatedDate": "2018-11-14T23:03:52.894+0000", + * "Description": "My Python layer", + * "LayerArn": "arn:aws:lambda:us-west-2:123456789012:layer:my-layer", + * "LayerVersionArn": "arn:aws:lambda:us-west-2:123456789012:layer:my-layer:1", + * "LicenseInfo": "MIT", + * "Version": 1 + * } + * *\/ + * // example id: to-create-a-lambda-layer-version-1586491213595 + * ``` + * */ export class PublishLayerVersionCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/PublishVersionCommand.ts b/clients/client-lambda/src/commands/PublishVersionCommand.ts index 19940b8c94bc..a93c44cfa76d 100644 --- a/clients/client-lambda/src/commands/PublishVersionCommand.ts +++ b/clients/client-lambda/src/commands/PublishVersionCommand.ts @@ -200,6 +200,48 @@ export interface PublishVersionCommandOutput extends FunctionConfiguration, __Me *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To publish a version of a Lambda function + * ```javascript + * // This operation publishes a version of a Lambda function + * const input = { + * "CodeSha256": "", + * "Description": "", + * "FunctionName": "myFunction" + * }; + * const command = new PublishVersionCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "CodeSha256": "YFgDgEKG3ugvF1+pX64gV6tu9qNuIYNUdgJm8nCxsm4=", + * "CodeSize": 5797206, + * "Description": "Process image objects from Amazon S3.", + * "Environment": { + * "Variables": { + * "BUCKET": "my-bucket-1xpuxmplzrlbh", + * "PREFIX": "inbound" + * } + * }, + * "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function", + * "FunctionName": "my-function", + * "Handler": "index.handler", + * "KMSKeyArn": "arn:aws:kms:us-west-2:123456789012:key/b0844d6c-xmpl-4463-97a4-d49f50839966", + * "LastModified": "2020-04-10T19:06:32.563+0000", + * "LastUpdateStatus": "Successful", + * "MemorySize": 256, + * "RevisionId": "b75dcd81-xmpl-48a8-a75a-93ba8b5b9727", + * "Role": "arn:aws:iam::123456789012:role/lambda-role", + * "Runtime": "nodejs12.x", + * "State": "Active", + * "Timeout": 5, + * "TracingConfig": { + * "Mode": "Active" + * }, + * "Version": "1" + * } + * *\/ + * // example id: to-publish-a-version-of-a-lambda-function-1481650704986 + * ``` + * */ export class PublishVersionCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/PutFunctionConcurrencyCommand.ts b/clients/client-lambda/src/commands/PutFunctionConcurrencyCommand.ts index b59511c7b388..e177b59dcb79 100644 --- a/clients/client-lambda/src/commands/PutFunctionConcurrencyCommand.ts +++ b/clients/client-lambda/src/commands/PutFunctionConcurrencyCommand.ts @@ -80,6 +80,23 @@ export interface PutFunctionConcurrencyCommandOutput extends Concurrency, __Meta *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To configure a reserved concurrency limit for a function + * ```javascript + * // The following example configures 100 reserved concurrent executions for the my-function function. + * const input = { + * "FunctionName": "my-function", + * "ReservedConcurrentExecutions": 100 + * }; + * const command = new PutFunctionConcurrencyCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "ReservedConcurrentExecutions": 100 + * } + * *\/ + * // example id: to-configure-a-reserved-concurrency-limit-for-a-function-1586491405956 + * ``` + * */ export class PutFunctionConcurrencyCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/PutFunctionEventInvokeConfigCommand.ts b/clients/client-lambda/src/commands/PutFunctionEventInvokeConfigCommand.ts index dc2fa8297846..4c24f684a7e8 100644 --- a/clients/client-lambda/src/commands/PutFunctionEventInvokeConfigCommand.ts +++ b/clients/client-lambda/src/commands/PutFunctionEventInvokeConfigCommand.ts @@ -106,6 +106,31 @@ export interface PutFunctionEventInvokeConfigCommandOutput extends FunctionEvent *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To configure error handling for asynchronous invocation + * ```javascript + * // The following example sets a maximum event age of one hour and disables retries for the specified function. + * const input = { + * "FunctionName": "my-function", + * "MaximumEventAgeInSeconds": 3600, + * "MaximumRetryAttempts": 0 + * }; + * const command = new PutFunctionEventInvokeConfigCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "DestinationConfig": { + * "OnFailure": {}, + * "OnSuccess": {} + * }, + * "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function:$LATEST", + * "LastModified": "${timestamp}", + * "MaximumEventAgeInSeconds": 3600, + * "MaximumRetryAttempts": 0 + * } + * *\/ + * // example id: to-configure-error-handling-for-asynchronous-invocation-1586491524021 + * ``` + * */ export class PutFunctionEventInvokeConfigCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/PutProvisionedConcurrencyConfigCommand.ts b/clients/client-lambda/src/commands/PutProvisionedConcurrencyConfigCommand.ts index ad990f865db6..7ff476c69bf8 100644 --- a/clients/client-lambda/src/commands/PutProvisionedConcurrencyConfigCommand.ts +++ b/clients/client-lambda/src/commands/PutProvisionedConcurrencyConfigCommand.ts @@ -83,6 +83,27 @@ export interface PutProvisionedConcurrencyConfigCommandOutput *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To allocate provisioned concurrency + * ```javascript + * // The following example allocates 100 provisioned concurrency for the BLUE alias of the specified function. + * const input = { + * "FunctionName": "my-function", + * "ProvisionedConcurrentExecutions": 100, + * "Qualifier": "BLUE" + * }; + * const command = new PutProvisionedConcurrencyConfigCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "AllocatedProvisionedConcurrentExecutions": 0, + * "LastModified": "2019-11-21T19:32:12+0000", + * "RequestedProvisionedConcurrentExecutions": 100, + * "Status": "IN_PROGRESS" + * } + * *\/ + * // example id: to-allocate-provisioned-concurrency-1586491651377 + * ``` + * */ export class PutProvisionedConcurrencyConfigCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/RemoveLayerVersionPermissionCommand.ts b/clients/client-lambda/src/commands/RemoveLayerVersionPermissionCommand.ts index 76b3cc3b3846..0b2cd041b946 100644 --- a/clients/client-lambda/src/commands/RemoveLayerVersionPermissionCommand.ts +++ b/clients/client-lambda/src/commands/RemoveLayerVersionPermissionCommand.ts @@ -87,6 +87,19 @@ export interface RemoveLayerVersionPermissionCommandOutput extends __MetadataBea *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To delete layer-version permissions + * ```javascript + * // The following example deletes permission for an account to configure a layer version. + * const input = { + * "LayerName": "my-layer", + * "StatementId": "xaccount", + * "VersionNumber": 1 + * }; + * const command = new RemoveLayerVersionPermissionCommand(input); + * await client.send(command); + * // example id: to-delete-layer-version-permissions-1586491829416 + * ``` + * */ export class RemoveLayerVersionPermissionCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/RemovePermissionCommand.ts b/clients/client-lambda/src/commands/RemovePermissionCommand.ts index 2cc0693d6924..19e04c895b62 100644 --- a/clients/client-lambda/src/commands/RemovePermissionCommand.ts +++ b/clients/client-lambda/src/commands/RemovePermissionCommand.ts @@ -88,6 +88,19 @@ export interface RemovePermissionCommandOutput extends __MetadataBearer {} *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To remove a Lambda function's permissions + * ```javascript + * // The following example removes a permissions statement named xaccount from the PROD alias of a function named my-function. + * const input = { + * "FunctionName": "my-function", + * "Qualifier": "PROD", + * "StatementId": "xaccount" + * }; + * const command = new RemovePermissionCommand(input); + * await client.send(command); + * // example id: to-remove-a-lambda-functions-permissions-1481661337021 + * ``` + * */ export class RemovePermissionCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/TagResourceCommand.ts b/clients/client-lambda/src/commands/TagResourceCommand.ts index 37b6d468c2b1..057e2b92d06c 100644 --- a/clients/client-lambda/src/commands/TagResourceCommand.ts +++ b/clients/client-lambda/src/commands/TagResourceCommand.ts @@ -72,6 +72,20 @@ export interface TagResourceCommandOutput extends __MetadataBearer {} *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To add tags to an existing Lambda function + * ```javascript + * // The following example adds a tag with the key name DEPARTMENT and a value of 'Department A' to the specified Lambda function. + * const input = { + * "Resource": "arn:aws:lambda:us-west-2:123456789012:function:my-function", + * "Tags": { + * "DEPARTMENT": "Department A" + * } + * }; + * const command = new TagResourceCommand(input); + * await client.send(command); + * // example id: to-add-tags-to-an-existing-lambda-function-1586491890446 + * ``` + * */ export class TagResourceCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/UntagResourceCommand.ts b/clients/client-lambda/src/commands/UntagResourceCommand.ts index a177ffba8354..536947708814 100644 --- a/clients/client-lambda/src/commands/UntagResourceCommand.ts +++ b/clients/client-lambda/src/commands/UntagResourceCommand.ts @@ -72,6 +72,20 @@ export interface UntagResourceCommandOutput extends __MetadataBearer {} *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To remove tags from an existing Lambda function + * ```javascript + * // The following example removes the tag with the key name DEPARTMENT tag from the my-function Lambda function. + * const input = { + * "Resource": "arn:aws:lambda:us-west-2:123456789012:function:my-function", + * "TagKeys": [ + * "DEPARTMENT" + * ] + * }; + * const command = new UntagResourceCommand(input); + * await client.send(command); + * // example id: to-remove-tags-from-an-existing-lambda-function-1586491956425 + * ``` + * */ export class UntagResourceCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/UpdateAliasCommand.ts b/clients/client-lambda/src/commands/UpdateAliasCommand.ts index 0578bdcfc892..dfa91e4492ce 100644 --- a/clients/client-lambda/src/commands/UpdateAliasCommand.ts +++ b/clients/client-lambda/src/commands/UpdateAliasCommand.ts @@ -102,6 +102,38 @@ export interface UpdateAliasCommandOutput extends AliasConfiguration, __Metadata *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To update a function alias + * ```javascript + * // The following example updates the alias named BLUE to send 30% of traffic to version 2 and 70% to version 1. + * const input = { + * "FunctionName": "my-function", + * "FunctionVersion": "2", + * "Name": "BLUE", + * "RoutingConfig": { + * "AdditionalVersionWeights": { + * "1": 0.7 + * } + * } + * }; + * const command = new UpdateAliasCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "AliasArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function:BLUE", + * "Description": "Production environment BLUE.", + * "FunctionVersion": "2", + * "Name": "BLUE", + * "RevisionId": "594f41fb-xmpl-4c20-95c7-6ca5f2a92c93", + * "RoutingConfig": { + * "AdditionalVersionWeights": { + * "1": 0.7 + * } + * } + * } + * *\/ + * // example id: to-update-a-function-alias-1481650817950 + * ``` + * */ export class UpdateAliasCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/UpdateEventSourceMappingCommand.ts b/clients/client-lambda/src/commands/UpdateEventSourceMappingCommand.ts index da349b2c924d..78cca4f590e3 100644 --- a/clients/client-lambda/src/commands/UpdateEventSourceMappingCommand.ts +++ b/clients/client-lambda/src/commands/UpdateEventSourceMappingCommand.ts @@ -303,6 +303,32 @@ export interface UpdateEventSourceMappingCommandOutput extends EventSourceMappin *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To update a Lambda function event source mapping + * ```javascript + * // This operation updates a Lambda function event source mapping + * const input = { + * "BatchSize": 123, + * "Enabled": true, + * "FunctionName": "myFunction", + * "UUID": "1234xCy789012" + * }; + * const command = new UpdateEventSourceMappingCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "BatchSize": 123, + * "EventSourceArn": "arn:aws:s3:::examplebucket/*", + * "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:myFunction", + * "LastModified": "2016-11-21T19:49:20.006+0000", + * "LastProcessingResult": "", + * "State": "", + * "StateTransitionReason": "", + * "UUID": "1234xCy789012" + * } + * *\/ + * // example id: to-update-a-lambda-function-event-source-mapping-1481650907413 + * ``` + * */ export class UpdateEventSourceMappingCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/UpdateFunctionCodeCommand.ts b/clients/client-lambda/src/commands/UpdateFunctionCodeCommand.ts index 6cf086207881..3b98430fab37 100644 --- a/clients/client-lambda/src/commands/UpdateFunctionCodeCommand.ts +++ b/clients/client-lambda/src/commands/UpdateFunctionCodeCommand.ts @@ -229,6 +229,39 @@ export interface UpdateFunctionCodeCommandOutput extends FunctionConfiguration, *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To update a Lambda function's code + * ```javascript + * // The following example replaces the code of the unpublished ($LATEST) version of a function named my-function with the contents of the specified zip file in Amazon S3. + * const input = { + * "FunctionName": "my-function", + * "S3Bucket": "my-bucket-1xpuxmplzrlbh", + * "S3Key": "function.zip" + * }; + * const command = new UpdateFunctionCodeCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "CodeSha256": "PFn4S+er27qk+UuZSTKEQfNKG/XNn7QJs90mJgq6oH8=", + * "CodeSize": 308, + * "Description": "", + * "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", + * "FunctionName": "my-function", + * "Handler": "index.handler", + * "LastModified": "2019-08-14T22:26:11.234+0000", + * "MemorySize": 128, + * "RevisionId": "873282ed-xmpl-4dc8-a069-d0c647e470c6", + * "Role": "arn:aws:iam::123456789012:role/lambda-role", + * "Runtime": "nodejs12.x", + * "Timeout": 3, + * "TracingConfig": { + * "Mode": "PassThrough" + * }, + * "Version": "$LATEST" + * } + * *\/ + * // example id: to-update-a-lambda-functions-code-1481650992672 + * ``` + * */ export class UpdateFunctionCodeCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/UpdateFunctionConfigurationCommand.ts b/clients/client-lambda/src/commands/UpdateFunctionConfigurationCommand.ts index 96158d9c4e6b..cd4d3110cff0 100644 --- a/clients/client-lambda/src/commands/UpdateFunctionConfigurationCommand.ts +++ b/clients/client-lambda/src/commands/UpdateFunctionConfigurationCommand.ts @@ -272,6 +272,38 @@ export interface UpdateFunctionConfigurationCommandOutput extends FunctionConfig *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To update a Lambda function's configuration + * ```javascript + * // The following example modifies the memory size to be 256 MB for the unpublished ($LATEST) version of a function named my-function. + * const input = { + * "FunctionName": "my-function", + * "MemorySize": 256 + * }; + * const command = new UpdateFunctionConfigurationCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "CodeSha256": "PFn4S+er27qk+UuZSTKEQfNKG/XNn7QJs90mJgq6oH8=", + * "CodeSize": 308, + * "Description": "", + * "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", + * "FunctionName": "my-function", + * "Handler": "index.handler", + * "LastModified": "2019-08-14T22:26:11.234+0000", + * "MemorySize": 256, + * "RevisionId": "873282ed-xmpl-4dc8-a069-d0c647e470c6", + * "Role": "arn:aws:iam::123456789012:role/lambda-role", + * "Runtime": "nodejs12.x", + * "Timeout": 3, + * "TracingConfig": { + * "Mode": "PassThrough" + * }, + * "Version": "$LATEST" + * } + * *\/ + * // example id: to-update-a-lambda-functions-configuration-1481651096447 + * ``` + * */ export class UpdateFunctionConfigurationCommand extends $Command .classBuilder< diff --git a/clients/client-lambda/src/commands/UpdateFunctionEventInvokeConfigCommand.ts b/clients/client-lambda/src/commands/UpdateFunctionEventInvokeConfigCommand.ts index e99a3341a03f..9bc4bcfce8ab 100644 --- a/clients/client-lambda/src/commands/UpdateFunctionEventInvokeConfigCommand.ts +++ b/clients/client-lambda/src/commands/UpdateFunctionEventInvokeConfigCommand.ts @@ -97,6 +97,36 @@ export interface UpdateFunctionEventInvokeConfigCommandOutput extends FunctionEv *

Base exception class for all service exceptions from Lambda service.

* * @public + * @example To update an asynchronous invocation configuration + * ```javascript + * // The following example adds an on-failure destination to the existing asynchronous invocation configuration for a function named my-function. + * const input = { + * "DestinationConfig": { + * "OnFailure": { + * "Destination": "arn:aws:sqs:us-east-2:123456789012:destination" + * } + * }, + * "FunctionName": "my-function" + * }; + * const command = new UpdateFunctionEventInvokeConfigCommand(input); + * const response = await client.send(command); + * /* response == + * { + * "DestinationConfig": { + * "OnFailure": { + * "Destination": "arn:aws:sqs:us-east-2:123456789012:destination" + * }, + * "OnSuccess": {} + * }, + * "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function:$LATEST", + * "LastModified": 1573687896.493, + * "MaximumEventAgeInSeconds": 3600, + * "MaximumRetryAttempts": 0 + * } + * *\/ + * // example id: to-update-an-asynchronous-invocation-configuration-1586492061186 + * ``` + * */ export class UpdateFunctionEventInvokeConfigCommand extends $Command .classBuilder<