diff --git a/clients/client-lambda/src/commands/AddPermissionCommand.ts b/clients/client-lambda/src/commands/AddPermissionCommand.ts index c839d32407706..1e3b0730c46f8 100644 --- a/clients/client-lambda/src/commands/AddPermissionCommand.ts +++ b/clients/client-lambda/src/commands/AddPermissionCommand.ts @@ -28,7 +28,7 @@ export interface AddPermissionCommandInput extends AddPermissionRequest {} export interface AddPermissionCommandOutput extends AddPermissionResponse, __MetadataBearer {} /** - *

Grants an Amazon Web Servicesservice, Amazon Web Services account, or Amazon Web Services organization + *

Grants a principal * permission to use a function. You can apply the policy at the function level, or specify a qualifier to restrict * access to a single version or alias. If you use a qualifier, the invoker must use the full Amazon Resource Name * (ARN) of that version or alias to invoke the function. Note: Lambda does not support adding policies @@ -93,6 +93,11 @@ export interface AddPermissionCommandOutput extends AddPermissionResponse, __Met * * * + * @throws {@link PublicPolicyException} (client fault) + *

Lambda prevented your policy from being created because it would grant public access to your function. If you intended to + * create a public policy, use the PutPublicAccessBlockConfig API action to configure your function's public-access settings + * to allow public policies.

+ * * @throws {@link ResourceConflictException} (client fault) *

The resource already exists, or another operation is in progress.

* diff --git a/clients/client-lambda/src/commands/CreateCodeSigningConfigCommand.ts b/clients/client-lambda/src/commands/CreateCodeSigningConfigCommand.ts index 04cd6b19d84fb..f20ba5bdf78e4 100644 --- a/clients/client-lambda/src/commands/CreateCodeSigningConfigCommand.ts +++ b/clients/client-lambda/src/commands/CreateCodeSigningConfigCommand.ts @@ -47,6 +47,9 @@ export interface CreateCodeSigningConfigCommandOutput extends CreateCodeSigningC * CodeSigningPolicies: { // CodeSigningPolicies * UntrustedArtifactOnDeployment: "Warn" || "Enforce", * }, + * Tags: { // Tags + * "": "STRING_VALUE", + * }, * }; * const command = new CreateCodeSigningConfigCommand(input); * const response = await client.send(command); diff --git a/clients/client-lambda/src/commands/CreateEventSourceMappingCommand.ts b/clients/client-lambda/src/commands/CreateEventSourceMappingCommand.ts index ccc29ab817a31..21114d2328b6f 100644 --- a/clients/client-lambda/src/commands/CreateEventSourceMappingCommand.ts +++ b/clients/client-lambda/src/commands/CreateEventSourceMappingCommand.ts @@ -175,6 +175,9 @@ export interface CreateEventSourceMappingCommandOutput extends EventSourceMappin * MaximumRecordAgeInSeconds: Number("int"), * BisectBatchOnFunctionError: true || false, * MaximumRetryAttempts: Number("int"), + * Tags: { // Tags + * "": "STRING_VALUE", + * }, * TumblingWindowInSeconds: Number("int"), * Topics: [ // Topics * "STRING_VALUE", @@ -289,6 +292,7 @@ export interface CreateEventSourceMappingCommandOutput extends EventSourceMappin * // ErrorCode: "STRING_VALUE", * // Message: "STRING_VALUE", * // }, + * // EventSourceMappingArn: "STRING_VALUE", * // }; * * ``` diff --git a/clients/client-lambda/src/commands/DeleteEventSourceMappingCommand.ts b/clients/client-lambda/src/commands/DeleteEventSourceMappingCommand.ts index 75139d1cc3ae7..21ae81478fff4 100644 --- a/clients/client-lambda/src/commands/DeleteEventSourceMappingCommand.ts +++ b/clients/client-lambda/src/commands/DeleteEventSourceMappingCommand.ts @@ -116,6 +116,7 @@ export interface DeleteEventSourceMappingCommandOutput extends EventSourceMappin * // ErrorCode: "STRING_VALUE", * // Message: "STRING_VALUE", * // }, + * // EventSourceMappingArn: "STRING_VALUE", * // }; * * ``` diff --git a/clients/client-lambda/src/commands/DeleteResourcePolicyCommand.ts b/clients/client-lambda/src/commands/DeleteResourcePolicyCommand.ts index 438cb8aadc3c4..9646e4a113e22 100644 --- a/clients/client-lambda/src/commands/DeleteResourcePolicyCommand.ts +++ b/clients/client-lambda/src/commands/DeleteResourcePolicyCommand.ts @@ -28,7 +28,11 @@ export interface DeleteResourcePolicyCommandInput extends DeleteResourcePolicyRe export interface DeleteResourcePolicyCommandOutput extends __MetadataBearer {} /** - *

Deletes a resource-based policy from a function.

+ * + *

The option to create and modify full JSON resource-based policies, and to use the PutResourcePolicy, GetResourcePolicy, and DeleteResourcePolicy APIs, won't be + * available in all Amazon Web Services Regions until September 30, 2024.

+ *
+ *

Deletes a resource-based policy from a function.

* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript diff --git a/clients/client-lambda/src/commands/GetEventSourceMappingCommand.ts b/clients/client-lambda/src/commands/GetEventSourceMappingCommand.ts index 1fdd86fa1f3cf..7d2caa2950c44 100644 --- a/clients/client-lambda/src/commands/GetEventSourceMappingCommand.ts +++ b/clients/client-lambda/src/commands/GetEventSourceMappingCommand.ts @@ -114,6 +114,7 @@ export interface GetEventSourceMappingCommandOutput extends EventSourceMappingCo * // ErrorCode: "STRING_VALUE", * // Message: "STRING_VALUE", * // }, + * // EventSourceMappingArn: "STRING_VALUE", * // }; * * ``` diff --git a/clients/client-lambda/src/commands/GetPublicAccessBlockConfigCommand.ts b/clients/client-lambda/src/commands/GetPublicAccessBlockConfigCommand.ts index 36b4be891ea95..b8ec01cdbbf50 100644 --- a/clients/client-lambda/src/commands/GetPublicAccessBlockConfigCommand.ts +++ b/clients/client-lambda/src/commands/GetPublicAccessBlockConfigCommand.ts @@ -28,7 +28,11 @@ export interface GetPublicAccessBlockConfigCommandInput extends GetPublicAccessB export interface GetPublicAccessBlockConfigCommandOutput extends GetPublicAccessBlockConfigResponse, __MetadataBearer {} /** - *

Retrieve the public-access settings for a function.

+ * + *

The option to configure public-access settings, and to use the PutPublicAccessBlock and GetPublicAccessBlock APIs, won't be + * available in all Amazon Web Services Regions until September 30, 2024.

+ *
+ *

Retrieve the public-access settings for a function.

* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript diff --git a/clients/client-lambda/src/commands/GetResourcePolicyCommand.ts b/clients/client-lambda/src/commands/GetResourcePolicyCommand.ts index 31b2dbacab94d..f6f3cdc058f92 100644 --- a/clients/client-lambda/src/commands/GetResourcePolicyCommand.ts +++ b/clients/client-lambda/src/commands/GetResourcePolicyCommand.ts @@ -28,7 +28,11 @@ export interface GetResourcePolicyCommandInput extends GetResourcePolicyRequest export interface GetResourcePolicyCommandOutput extends GetResourcePolicyResponse, __MetadataBearer {} /** - *

Retrieves the resource-based policy attached to a function.

+ * + *

The option to create and modify full JSON resource-based policies, and to use the PutResourcePolicy, GetResourcePolicy, and DeleteResourcePolicy APIs, won't be + * available in all Amazon Web Services Regions until September 30, 2024.

+ *
+ *

Retrieves the resource-based policy attached to a function.

* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript diff --git a/clients/client-lambda/src/commands/ListEventSourceMappingsCommand.ts b/clients/client-lambda/src/commands/ListEventSourceMappingsCommand.ts index 4a3878a7194d4..804cd2f314113 100644 --- a/clients/client-lambda/src/commands/ListEventSourceMappingsCommand.ts +++ b/clients/client-lambda/src/commands/ListEventSourceMappingsCommand.ts @@ -120,6 +120,7 @@ export interface ListEventSourceMappingsCommandOutput extends ListEventSourceMap * // ErrorCode: "STRING_VALUE", * // Message: "STRING_VALUE", * // }, + * // EventSourceMappingArn: "STRING_VALUE", * // }, * // ], * // }; diff --git a/clients/client-lambda/src/commands/ListTagsCommand.ts b/clients/client-lambda/src/commands/ListTagsCommand.ts index d54d27c36f0d2..9c64c95fe39c1 100644 --- a/clients/client-lambda/src/commands/ListTagsCommand.ts +++ b/clients/client-lambda/src/commands/ListTagsCommand.ts @@ -28,8 +28,8 @@ export interface ListTagsCommandInput extends ListTagsRequest {} export interface ListTagsCommandOutput extends ListTagsResponse, __MetadataBearer {} /** - *

Returns a function's tags. You can - * also view tags with GetFunction.

+ *

Returns a function, event source mapping, or code signing configuration's tags. You can + * also view funciton tags with GetFunction.

* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript diff --git a/clients/client-lambda/src/commands/PutPublicAccessBlockConfigCommand.ts b/clients/client-lambda/src/commands/PutPublicAccessBlockConfigCommand.ts index bb093101f7f31..24423e20afc6f 100644 --- a/clients/client-lambda/src/commands/PutPublicAccessBlockConfigCommand.ts +++ b/clients/client-lambda/src/commands/PutPublicAccessBlockConfigCommand.ts @@ -28,7 +28,11 @@ export interface PutPublicAccessBlockConfigCommandInput extends PutPublicAccessB export interface PutPublicAccessBlockConfigCommandOutput extends PutPublicAccessBlockConfigResponse, __MetadataBearer {} /** - *

Configure your function's public-access settings.

+ * + *

The option to configure public-access settings, and to use the PutPublicAccessBlock and GetPublicAccessBlock APIs, won't be + * available in all Amazon Web Services Regions until September 30, 2024.

+ *
+ *

Configure your function's public-access settings.

*

To control public access to a Lambda function, you can choose whether to allow the creation of * resource-based policies that * allow public access to that function. You can also block public access to a function, even if it has an existing resource-based diff --git a/clients/client-lambda/src/commands/PutResourcePolicyCommand.ts b/clients/client-lambda/src/commands/PutResourcePolicyCommand.ts index 7099e4f3f2732..65eac3010adf0 100644 --- a/clients/client-lambda/src/commands/PutResourcePolicyCommand.ts +++ b/clients/client-lambda/src/commands/PutResourcePolicyCommand.ts @@ -28,7 +28,11 @@ export interface PutResourcePolicyCommandInput extends PutResourcePolicyRequest export interface PutResourcePolicyCommandOutput extends PutResourcePolicyResponse, __MetadataBearer {} /** - *

Adds a resource-based policy + * + *

The option to create and modify full JSON resource-based policies, and to use the PutResourcePolicy, GetResourcePolicy, and DeleteResourcePolicy APIs, won't be + * available in all Amazon Web Services Regions until September 30, 2024.

+ * + *

Adds a resource-based policy * to a function. You can use resource-based policies to grant access to other * Amazon Web Services accounts, * organizations, or diff --git a/clients/client-lambda/src/commands/RemovePermissionCommand.ts b/clients/client-lambda/src/commands/RemovePermissionCommand.ts index 080b569e8cb47..2cc0693d69249 100644 --- a/clients/client-lambda/src/commands/RemovePermissionCommand.ts +++ b/clients/client-lambda/src/commands/RemovePermissionCommand.ts @@ -70,6 +70,11 @@ export interface RemovePermissionCommandOutput extends __MetadataBearer {} * * * + * @throws {@link PublicPolicyException} (client fault) + *

Lambda prevented your policy from being created because it would grant public access to your function. If you intended to + * create a public policy, use the PutPublicAccessBlockConfig API action to configure your function's public-access settings + * to allow public policies.

+ * * @throws {@link ResourceNotFoundException} (client fault) *

The resource specified in the request does not exist.

* diff --git a/clients/client-lambda/src/commands/TagResourceCommand.ts b/clients/client-lambda/src/commands/TagResourceCommand.ts index c2c0cf81a1453..37b6d468c2b13 100644 --- a/clients/client-lambda/src/commands/TagResourceCommand.ts +++ b/clients/client-lambda/src/commands/TagResourceCommand.ts @@ -28,7 +28,7 @@ export interface TagResourceCommandInput extends TagResourceRequest {} export interface TagResourceCommandOutput extends __MetadataBearer {} /** - *

Adds tags to a function.

+ *

Adds tags to a function, event source mapping, or code signing configuration.

* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript diff --git a/clients/client-lambda/src/commands/UntagResourceCommand.ts b/clients/client-lambda/src/commands/UntagResourceCommand.ts index 54d16a0700a43..a177ffba83548 100644 --- a/clients/client-lambda/src/commands/UntagResourceCommand.ts +++ b/clients/client-lambda/src/commands/UntagResourceCommand.ts @@ -28,7 +28,7 @@ export interface UntagResourceCommandInput extends UntagResourceRequest {} export interface UntagResourceCommandOutput extends __MetadataBearer {} /** - *

Removes tags from a function.

+ *

Removes tags from a function, event source mapping, or code signing configuration.

* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript diff --git a/clients/client-lambda/src/commands/UpdateEventSourceMappingCommand.ts b/clients/client-lambda/src/commands/UpdateEventSourceMappingCommand.ts index f4616e31a0f98..da349b2c924d6 100644 --- a/clients/client-lambda/src/commands/UpdateEventSourceMappingCommand.ts +++ b/clients/client-lambda/src/commands/UpdateEventSourceMappingCommand.ts @@ -269,6 +269,7 @@ export interface UpdateEventSourceMappingCommandOutput extends EventSourceMappin * // ErrorCode: "STRING_VALUE", * // Message: "STRING_VALUE", * // }, + * // EventSourceMappingArn: "STRING_VALUE", * // }; * * ``` diff --git a/clients/client-lambda/src/models/models_0.ts b/clients/client-lambda/src/models/models_0.ts index ac39ab22c1049..f78c65be98078 100644 --- a/clients/client-lambda/src/models/models_0.ts +++ b/clients/client-lambda/src/models/models_0.ts @@ -397,7 +397,7 @@ export interface AddPermissionRequest { Action: string | undefined; /** - *

The Amazon Web Servicesservice or Amazon Web Services account that invokes the function. If you specify a + *

The Amazon Web Servicesservice, Amazon Web Services account, IAM user, or IAM role that invokes the function. If you specify a * service, use SourceArn or SourceAccount to limit who can invoke the function through * that service.

* @public @@ -466,6 +466,37 @@ export interface AddPermissionResponse { Statement?: string; } +/** + *

Lambda prevented your policy from being created because it would grant public access to your function. If you intended to + * create a public policy, use the PutPublicAccessBlockConfig API action to configure your function's public-access settings + * to allow public policies.

+ * @public + */ +export class PublicPolicyException extends __BaseException { + readonly name: "PublicPolicyException" = "PublicPolicyException"; + readonly $fault: "client" = "client"; + /** + *

The exception type.

+ * @public + */ + Type?: string; + + Message?: string; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "PublicPolicyException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, PublicPolicyException.prototype); + this.Type = opts.Type; + this.Message = opts.Message; + } +} + /** *

The traffic-shifting configuration of a Lambda function alias.

* @public @@ -687,6 +718,12 @@ export interface CreateCodeSigningConfigRequest { * @public */ CodeSigningPolicies?: CodeSigningPolicies; + + /** + *

A list of tags to add to the code signing configuration.

+ * @public + */ + Tags?: Record; } /** @@ -1204,6 +1241,12 @@ export interface CreateEventSourceMappingRequest { */ MaximumRetryAttempts?: number; + /** + *

A list of tags to apply to the event source mapping.

+ * @public + */ + Tags?: Record; + /** *

(Kinesis and DynamoDB Streams only) The duration in seconds of a processing window for DynamoDB and Kinesis Streams event sources. A value of 0 seconds indicates no tumbling window.

* @public @@ -1496,6 +1539,12 @@ export interface EventSourceMappingConfiguration { * @public */ FilterCriteriaError?: FilterCriteriaError; + + /** + *

The Amazon Resource Name (ARN) of the event source mapping.

+ * @public + */ + EventSourceMappingArn?: string; } /** @@ -6070,8 +6119,8 @@ export interface ListProvisionedConcurrencyConfigsResponse { */ export interface ListTagsRequest { /** - *

The function's Amazon Resource Name (ARN). - * Note: Lambda does not support adding tags to aliases or versions.

+ *

The resource's Amazon Resource Name (ARN). + * Note: Lambda does not support adding tags to function aliases or versions.

* @public */ Resource: string | undefined; @@ -6717,37 +6766,6 @@ export interface PutPublicAccessBlockConfigResponse { PublicAccessBlockConfig?: PublicAccessBlockConfig; } -/** - *

Lambda prevented your policy from being created because it would grant public access to your function. If you intended to - * create a public policy, use the PutPublicAccessBlockConfig API action to configure your function's public-access settings - * to allow public policies.

- * @public - */ -export class PublicPolicyException extends __BaseException { - readonly name: "PublicPolicyException" = "PublicPolicyException"; - readonly $fault: "client" = "client"; - /** - *

The exception type.

- * @public - */ - Type?: string; - - Message?: string; - /** - * @internal - */ - constructor(opts: __ExceptionOptionType) { - super({ - name: "PublicPolicyException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, PublicPolicyException.prototype); - this.Type = opts.Type; - this.Message = opts.Message; - } -} - /** * @public */ @@ -6972,13 +6990,13 @@ export interface RemovePermissionRequest { */ export interface TagResourceRequest { /** - *

The function's Amazon Resource Name (ARN).

+ *

The resource's Amazon Resource Name (ARN).

* @public */ Resource: string | undefined; /** - *

A list of tags to apply to the function.

+ *

A list of tags to apply to the resource.

* @public */ Tags: Record | undefined; @@ -6989,13 +7007,13 @@ export interface TagResourceRequest { */ export interface UntagResourceRequest { /** - *

The function's Amazon Resource Name (ARN).

+ *

The resource's Amazon Resource Name (ARN).

* @public */ Resource: string | undefined; /** - *

A list of tag keys to remove from the function.

+ *

A list of tag keys to remove from the resource.

* @public */ TagKeys: string[] | undefined; diff --git a/clients/client-lambda/src/protocols/Aws_restJson1.ts b/clients/client-lambda/src/protocols/Aws_restJson1.ts index ac50673fceaf4..2667889460ccb 100644 --- a/clients/client-lambda/src/protocols/Aws_restJson1.ts +++ b/clients/client-lambda/src/protocols/Aws_restJson1.ts @@ -431,6 +431,7 @@ export const se_CreateCodeSigningConfigCommand = async ( AllowedPublishers: (_) => _json(_), CodeSigningPolicies: (_) => _json(_), Description: [], + Tags: (_) => _json(_), }) ); b.m("POST").h(headers).b(body); @@ -474,6 +475,7 @@ export const se_CreateEventSourceMappingCommand = async ( SourceAccessConfigurations: (_) => _json(_), StartingPosition: [], StartingPositionTimestamp: (_) => _.getTime() / 1_000, + Tags: (_) => _json(_), Topics: (_) => _json(_), TumblingWindowInSeconds: [], }) @@ -2056,6 +2058,7 @@ export const de_CreateEventSourceMappingCommand = async ( DestinationConfig: _json, DocumentDBEventSourceConfig: _json, EventSourceArn: __expectString, + EventSourceMappingArn: __expectString, FilterCriteria: _json, FilterCriteriaError: _json, FunctionArn: __expectString, @@ -2221,6 +2224,7 @@ export const de_DeleteEventSourceMappingCommand = async ( DestinationConfig: _json, DocumentDBEventSourceConfig: _json, EventSourceArn: __expectString, + EventSourceMappingArn: __expectString, FilterCriteria: _json, FilterCriteriaError: _json, FunctionArn: __expectString, @@ -2475,6 +2479,7 @@ export const de_GetEventSourceMappingCommand = async ( DestinationConfig: _json, DocumentDBEventSourceConfig: _json, EventSourceArn: __expectString, + EventSourceMappingArn: __expectString, FilterCriteria: _json, FilterCriteriaError: _json, FunctionArn: __expectString, @@ -3625,6 +3630,7 @@ export const de_UpdateEventSourceMappingCommand = async ( DestinationConfig: _json, DocumentDBEventSourceConfig: _json, EventSourceArn: __expectString, + EventSourceMappingArn: __expectString, FilterCriteria: _json, FilterCriteriaError: _json, FunctionArn: __expectString, @@ -3848,6 +3854,9 @@ const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): case "TooManyRequestsException": case "com.amazonaws.lambda#TooManyRequestsException": throw await de_TooManyRequestsExceptionRes(parsedOutput, context); + case "PublicPolicyException": + case "com.amazonaws.lambda#PublicPolicyException": + throw await de_PublicPolicyExceptionRes(parsedOutput, context); case "CodeSigningConfigNotFoundException": case "com.amazonaws.lambda#CodeSigningConfigNotFoundException": throw await de_CodeSigningConfigNotFoundExceptionRes(parsedOutput, context); @@ -3941,9 +3950,6 @@ const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): case "UnsupportedMediaTypeException": case "com.amazonaws.lambda#UnsupportedMediaTypeException": throw await de_UnsupportedMediaTypeExceptionRes(parsedOutput, context); - case "PublicPolicyException": - case "com.amazonaws.lambda#PublicPolicyException": - throw await de_PublicPolicyExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ @@ -5049,6 +5055,7 @@ const de_EventSourceMappingConfiguration = (output: any, context: __SerdeContext DestinationConfig: _json, DocumentDBEventSourceConfig: _json, EventSourceArn: __expectString, + EventSourceMappingArn: __expectString, FilterCriteria: _json, FilterCriteriaError: _json, FunctionArn: __expectString, diff --git a/codegen/sdk-codegen/aws-models/lambda.json b/codegen/sdk-codegen/aws-models/lambda.json index c73cd56e49bd2..1516db5b629c5 100644 --- a/codegen/sdk-codegen/aws-models/lambda.json +++ b/codegen/sdk-codegen/aws-models/lambda.json @@ -1650,6 +1650,23 @@ ], "traits": { "smithy.api#documentation": "

Adds permissions to the resource-based policy of a version of an Lambda\n layer. Use this action to grant layer\n usage permission to other accounts. You can grant permission to a single account, all accounts in an organization,\n or all Amazon Web Services accounts.

\n

To revoke permission, call RemoveLayerVersionPermission with the statement ID that you\n specified when you added it.

", + "smithy.api#examples": [ + { + "title": "To add permissions to a layer version", + "documentation": "The following example grants permission for the account 223456789012 to use version 1 of a layer named my-layer.", + "input": { + "LayerName": "my-layer", + "VersionNumber": 1, + "StatementId": "xaccount", + "Action": "lambda:GetLayerVersion", + "Principal": "223456789012" + }, + "output": { + "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\"}", + "RevisionId": "35d87451-f796-4a3f-a618-95a3671b0a0c" + } + } + ], "smithy.api#http": { "method": "POST", "uri": "/2018-10-31/layers/{LayerName}/versions/{VersionNumber}/policy", @@ -1754,6 +1771,9 @@ { "target": "com.amazonaws.lambda#PreconditionFailedException" }, + { + "target": "com.amazonaws.lambda#PublicPolicyException" + }, { "target": "com.amazonaws.lambda#ResourceConflictException" }, @@ -1768,7 +1788,37 @@ } ], "traits": { - "smithy.api#documentation": "

Grants an Amazon Web Servicesservice, Amazon Web Services account, or Amazon Web Services organization\n permission to use a function. You can apply the policy at the function level, or specify a qualifier to restrict\n access to a single version or alias. If you use a qualifier, the invoker must use the full Amazon Resource Name\n (ARN) of that version or alias to invoke the function. Note: Lambda does not support adding policies\n to version $LATEST.

\n

To grant permission to another account, specify the account ID as the Principal. To grant\n permission to an organization defined in Organizations, specify the organization ID as the\n PrincipalOrgID. For Amazon Web Servicesservices, the principal is a domain-style identifier that\n the service defines, such as s3.amazonaws.com or sns.amazonaws.com. For Amazon Web Servicesservices, you can also specify the ARN of the associated resource as the SourceArn. If\n you grant permission to a service principal without specifying the source, other accounts could potentially\n configure resources in their account to invoke your Lambda function.

\n

This operation adds a statement to a resource-based permissions policy for the function. For more information\n about function policies, see Using resource-based policies for Lambda.

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

Grants a principal \n permission to use a function. You can apply the policy at the function level, or specify a qualifier to restrict\n access to a single version or alias. If you use a qualifier, the invoker must use the full Amazon Resource Name\n (ARN) of that version or alias to invoke the function. Note: Lambda does not support adding policies\n to version $LATEST.

\n

To grant permission to another account, specify the account ID as the Principal. To grant\n permission to an organization defined in Organizations, specify the organization ID as the\n PrincipalOrgID. For Amazon Web Servicesservices, the principal is a domain-style identifier that\n the service defines, such as s3.amazonaws.com or sns.amazonaws.com. For Amazon Web Servicesservices, you can also specify the ARN of the associated resource as the SourceArn. If\n you grant permission to a service principal without specifying the source, other accounts could potentially\n configure resources in their account to invoke your Lambda function.

\n

This operation adds a statement to a resource-based permissions policy for the function. For more information\n about function policies, see Using resource-based policies for Lambda.

", + "smithy.api#examples": [ + { + "title": "To grant Amazon S3 permission to invoke a function", + "documentation": "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.", + "input": { + "FunctionName": "my-function", + "StatementId": "s3", + "Action": "lambda:InvokeFunction", + "Principal": "s3.amazonaws.com", + "SourceArn": "arn:aws:s3:::my-bucket-1xpuxmplzrlbh/*", + "SourceAccount": "123456789012" + }, + "output": { + "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\"}}}" + } + }, + { + "title": "To grant another account permission to invoke a function", + "documentation": "The following example adds permission for account 223456789012 invoke a Lambda function named my-function.", + "input": { + "FunctionName": "my-function", + "StatementId": "xaccount", + "Action": "lambda:InvokeFunction", + "Principal": "223456789012" + }, + "output": { + "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\"}" + } + } + ], "smithy.api#http": { "method": "POST", "uri": "/2015-03-31/functions/{FunctionName}/policy", @@ -1804,7 +1854,7 @@ "Principal": { "target": "com.amazonaws.lambda#Principal", "traits": { - "smithy.api#documentation": "

The Amazon Web Servicesservice or Amazon Web Services account that invokes the function. If you specify a\n service, use SourceArn or SourceAccount to limit who can invoke the function through\n that service.

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

The Amazon Web Servicesservice, Amazon Web Services account, IAM user, or IAM role that invokes the function. If you specify a\n service, use SourceArn or SourceAccount to limit who can invoke the function through\n that service.

", "smithy.api#required": {} } }, @@ -2394,6 +2444,25 @@ ], "traits": { "smithy.api#documentation": "

Creates an alias for a\n Lambda function version. Use aliases to provide clients with a function identifier that you can update to invoke a\n different version.

\n

You can also map an alias to split invocation requests between two versions. Use the\n RoutingConfig parameter to specify a second version and the percentage of invocation requests that\n it receives.

", + "smithy.api#examples": [ + { + "title": "To create an alias for a Lambda function", + "documentation": "The following example creates an alias named LIVE that points to version 1 of the my-function Lambda function.", + "input": { + "FunctionName": "my-function", + "Name": "LIVE", + "FunctionVersion": "1", + "Description": "alias for live version of function" + }, + "output": { + "FunctionVersion": "1", + "Name": "LIVE", + "AliasArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function:LIVE", + "RevisionId": "873282ed-xmpl-4dc8-a069-d0c647e470c6", + "Description": "alias for live version of function" + } + } + ], "smithy.api#http": { "method": "POST", "uri": "/2015-03-31/functions/{FunctionName}/aliases", @@ -2489,6 +2558,12 @@ "traits": { "smithy.api#documentation": "

The code signing policies define the actions to take if the validation checks fail.

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

A list of tags to add to the code signing configuration.

" + } } }, "traits": { @@ -2537,6 +2612,26 @@ ], "traits": { "smithy.api#documentation": "

Creates a mapping between an event source and an Lambda function. Lambda reads items from the event source and invokes the function.

\n

For details about how to configure different event sources, see the following topics.

\n \n

The following error handling options are available only for stream sources (DynamoDB and Kinesis):

\n
    \n
  • \n

    \n BisectBatchOnFunctionError – If the function returns an error, split the batch in two and retry.

    \n
  • \n
  • \n

    \n DestinationConfig – Send discarded records to an Amazon SQS queue or Amazon SNS topic.

    \n
  • \n
  • \n

    \n MaximumRecordAgeInSeconds – Discard records older than the specified age. The default value is infinite (-1). When set to infinite (-1), failed records are retried until the record expires

    \n
  • \n
  • \n

    \n MaximumRetryAttempts – Discard records after the specified number of retries. The default value is infinite (-1). When set to infinite (-1), failed records are retried until the record expires.

    \n
  • \n
  • \n

    \n ParallelizationFactor – Process multiple batches from each shard concurrently.

    \n
  • \n
\n

For information about which configuration parameters apply to each event source, see the following topics.

\n ", + "smithy.api#examples": [ + { + "title": "To create a mapping between an event source and an AWS Lambda function", + "documentation": "The following example creates a mapping between an SQS queue and the my-function Lambda function.", + "input": { + "EventSourceArn": "arn:aws:sqs:us-west-2:123456789012:my-queue", + "FunctionName": "my-function", + "BatchSize": 5 + }, + "output": { + "UUID": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE", + "StateTransitionReason": "USER_INITIATED", + "LastModified": 1.569284520333e9, + "BatchSize": 5, + "State": "Creating", + "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function", + "EventSourceArn": "arn:aws:sqs:us-west-2:123456789012:my-queue" + } + } + ], "smithy.api#http": { "method": "POST", "uri": "/2015-03-31/event-source-mappings", @@ -2626,6 +2721,12 @@ "smithy.api#documentation": "

(Kinesis and DynamoDB Streams only) Discard records after the specified number of retries. The default value is infinite (-1). When set to infinite (-1), failed records are retried until the record expires.

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

A list of tags to apply to the event source mapping.

" + } + }, "TumblingWindowInSeconds": { "target": "com.amazonaws.lambda#TumblingWindowInSeconds", "traits": { @@ -2736,6 +2837,66 @@ ], "traits": { "smithy.api#documentation": "

Creates a Lambda function. To create a function, you need a deployment package and an execution role. The\n deployment package is a .zip file archive or container image that contains your function code. The execution role\n grants the function permission to use Amazon Web Servicesservices, such as Amazon CloudWatch Logs for log\n streaming and X-Ray for request tracing.

\n

If the deployment package is a container\n image, then you set the package type to Image. For a container image, the code property\n must include the URI of a container image in the Amazon ECR registry. You do not need to specify the\n handler and runtime properties.

\n

If the deployment package is a .zip file archive, then\n you set the package type to Zip. For a .zip file archive, the code property specifies the location of\n the .zip file. You must also specify the handler and runtime properties. The code in the deployment package must\n be compatible with the target instruction set architecture of the function (x86-64 or\n arm64). If you do not specify the architecture, then the default value is\n x86-64.

\n

When you create a function, Lambda provisions an instance of the function and its supporting\n resources. If your function connects to a VPC, this process can take a minute or so. During this time, you can't\n invoke or modify the function. The State, StateReason, and StateReasonCode\n fields in the response from GetFunctionConfiguration indicate when the function is ready to\n invoke. For more information, see Lambda function states.

\n

A function has an unpublished version, and can have published versions and aliases. The unpublished version\n changes when you update your function's code and configuration. A published version is a snapshot of your function\n code and configuration that can't be changed. An alias is a named resource that maps to a version, and can be\n changed to map to a different version. Use the Publish parameter to create version 1 of\n your function from its initial configuration.

\n

The other parameters let you configure version-specific and function-level settings. You can modify\n version-specific settings later with UpdateFunctionConfiguration. Function-level settings apply\n to both the unpublished and published versions of the function, and include tags (TagResource)\n and per-function concurrency limits (PutFunctionConcurrency).

\n

You can use code signing if your deployment package is a .zip file archive. To enable code signing for this\n function, specify the ARN of a code-signing configuration. When a user attempts to deploy a code package with\n UpdateFunctionCode, Lambda checks that the code package has a valid signature from\n a trusted publisher. The code-signing configuration includes set of signing profiles, which define the trusted\n publishers for this function.

\n

If another Amazon Web Services account or an Amazon Web Servicesservice invokes your function, use AddPermission to grant permission by creating a resource-based Identity and Access Management (IAM) policy. You can grant permissions at the function level, on a version, or on an alias.

\n

To invoke your function directly, use Invoke. To invoke your function in response to events\n in other Amazon Web Servicesservices, create an event source mapping (CreateEventSourceMapping),\n or configure a function trigger in the other service. For more information, see Invoking Lambda\n functions.

", + "smithy.api#examples": [ + { + "title": "To create a function", + "documentation": "The following example creates a function with a deployment package in Amazon S3 and enables X-Ray tracing and environment variable encryption.", + "input": { + "FunctionName": "my-function", + "Runtime": "nodejs12.x", + "Role": "arn:aws:iam::123456789012:role/lambda-role", + "Handler": "index.handler", + "Code": { + "S3Bucket": "my-bucket-1xpuxmplzrlbh", + "S3Key": "function.zip" + }, + "Description": "Process image objects from Amazon S3.", + "Timeout": 15, + "MemorySize": 256, + "Publish": true, + "Environment": { + "Variables": { + "BUCKET": "my-bucket-1xpuxmplzrlbh", + "PREFIX": "inbound" + } + }, + "KMSKeyArn": "arn:aws:kms:us-west-2:123456789012:key/b0844d6c-xmpl-4463-97a4-d49f50839966", + "TracingConfig": { + "Mode": "Active" + }, + "Tags": { + "DEPARTMENT": "Assets" + } + }, + "output": { + "FunctionName": "my-function", + "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function", + "Runtime": "nodejs12.x", + "Role": "arn:aws:iam::123456789012:role/lambda-role", + "Handler": "index.handler", + "CodeSize": 5797206, + "Description": "Process image objects from Amazon S3.", + "Timeout": 15, + "MemorySize": 256, + "LastModified": "2020-04-10T19:06:32.563+0000", + "CodeSha256": "YFgDgEKG3ugvF1+pX64gV6tu9qNuIYNUdgJm8nCxsm4=", + "Version": "1", + "Environment": { + "Variables": { + "PREFIX": "inbound", + "BUCKET": "my-bucket-1xpuxmplzrlbh" + } + }, + "KMSKeyArn": "arn:aws:kms:us-west-2:123456789012:key/b0844d6c-xmpl-4463-97a4-d49f50839966", + "TracingConfig": { + "Mode": "Active" + }, + "RevisionId": "b75dcd81-xmpl-48a8-a75a-93ba8b5b9727", + "State": "Active", + "LastUpdateStatus": "Successful" + } + } + ], "smithy.api#http": { "method": "POST", "uri": "/2015-03-31/functions", @@ -3074,6 +3235,16 @@ ], "traits": { "smithy.api#documentation": "

Deletes a Lambda function alias.

", + "smithy.api#examples": [ + { + "title": "To delete a Lambda function alias", + "documentation": "The following example deletes an alias named BLUE from a function named my-function", + "input": { + "FunctionName": "my-function", + "Name": "BLUE" + } + } + ], "smithy.api#http": { "method": "DELETE", "uri": "/2015-03-31/functions/{FunctionName}/aliases/{Name}", @@ -3239,6 +3410,16 @@ ], "traits": { "smithy.api#documentation": "

Deletes a Lambda function. To delete a specific function version, use the Qualifier parameter.\n Otherwise, all versions and aliases are deleted. This doesn't require the user to have explicit\n permissions for DeleteAlias.

\n

To delete Lambda event source mappings that invoke a function, use DeleteEventSourceMapping. For Amazon Web Servicesservices and resources that invoke your function\n directly, delete the trigger in the service where you originally configured it.

", + "smithy.api#examples": [ + { + "title": "To delete a version of a Lambda function", + "documentation": "The following example deletes version 1 of a Lambda function named my-function.", + "input": { + "FunctionName": "my-function", + "Qualifier": "1" + } + } + ], "smithy.api#http": { "method": "DELETE", "uri": "/2015-03-31/functions/{FunctionName}", @@ -3326,6 +3507,15 @@ ], "traits": { "smithy.api#documentation": "

Removes a concurrent execution limit from a function.

", + "smithy.api#examples": [ + { + "title": "To remove the reserved concurrent execution limit from a function", + "documentation": "The following example deletes the reserved concurrent execution limit from a function named my-function.", + "input": { + "FunctionName": "my-function" + } + } + ], "smithy.api#http": { "method": "DELETE", "uri": "/2017-10-31/functions/{FunctionName}/concurrency", @@ -3376,6 +3566,16 @@ ], "traits": { "smithy.api#documentation": "

Deletes the configuration for asynchronous invocation for a function, version, or alias.

\n

To configure options for asynchronous invocation, use PutFunctionEventInvokeConfig.

", + "smithy.api#examples": [ + { + "title": "To delete an asynchronous invocation configuration", + "documentation": "The following example deletes the asynchronous invocation configuration for the GREEN alias of a function named my-function.", + "input": { + "FunctionName": "my-function", + "Qualifier": "GREEN" + } + } + ], "smithy.api#http": { "method": "DELETE", "uri": "/2019-09-25/functions/{FunctionName}/event-invoke-config", @@ -3501,6 +3701,16 @@ ], "traits": { "smithy.api#documentation": "

Deletes a version of an Lambda\n layer. Deleted versions can no longer be viewed or added to functions. To avoid\n breaking functions, a copy of the version remains in Lambda until no functions refer to it.

", + "smithy.api#examples": [ + { + "title": "To delete a version of a Lambda layer", + "documentation": "The following example deletes version 2 of a layer named my-layer.", + "input": { + "LayerName": "my-layer", + "VersionNumber": 2 + } + } + ], "smithy.api#http": { "method": "DELETE", "uri": "/2018-10-31/layers/{LayerName}/versions/{VersionNumber}", @@ -3560,6 +3770,16 @@ ], "traits": { "smithy.api#documentation": "

Deletes the provisioned concurrency configuration for a function.

", + "smithy.api#examples": [ + { + "title": "To delete a provisioned concurrency configuration", + "documentation": "The following example deletes the provisioned concurrency configuration for the GREEN alias of a function named my-function.", + "input": { + "FunctionName": "my-function", + "Qualifier": "GREEN" + } + } + ], "smithy.api#http": { "method": "DELETE", "uri": "/2019-09-30/functions/{FunctionName}/provisioned-concurrency", @@ -3620,7 +3840,7 @@ } ], "traits": { - "smithy.api#documentation": "

Deletes a resource-based policy from a function.

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

The option to create and modify full JSON resource-based policies, and to use the PutResourcePolicy, GetResourcePolicy, and DeleteResourcePolicy APIs, won't be \n available in all Amazon Web Services Regions until September 30, 2024.

\n
\n

Deletes a resource-based policy from a function.

", "smithy.api#http": { "method": "DELETE", "uri": "/2024-09-16/resource-policy/{ResourceArn}", @@ -4001,6 +4221,16 @@ } } }, + "com.amazonaws.lambda#EventSourceMappingArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 85, + "max": 120 + }, + "smithy.api#pattern": "^arn:(aws[a-zA-Z-]*)?:lambda:[a-z]{2}((-gov)|(-iso([a-z]?)))?-[a-z]+-\\d{1}:\\d{12}:event-source-mapping:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$" + } + }, "com.amazonaws.lambda#EventSourceMappingConfiguration": { "type": "structure", "members": { @@ -4177,6 +4407,12 @@ "traits": { "smithy.api#documentation": "

An object that contains details about an error related to filter criteria encryption.

" } + }, + "EventSourceMappingArn": { + "target": "com.amazonaws.lambda#EventSourceMappingArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the event source mapping.

" + } } }, "traits": { @@ -4870,6 +5106,25 @@ ], "traits": { "smithy.api#documentation": "

Retrieves details about your account's limits and usage in an Amazon Web Services Region.

", + "smithy.api#examples": [ + { + "title": "To get account settings", + "documentation": "This operation takes no parameters and returns details about storage and concurrency quotas in the current Region.", + "output": { + "AccountLimit": { + "CodeSizeUnzipped": 262144000, + "UnreservedConcurrentExecutions": 1000, + "ConcurrentExecutions": 1000, + "CodeSizeZipped": 52428800, + "TotalCodeSize": 80530636800 + }, + "AccountUsage": { + "FunctionCount": 4, + "TotalCodeSize": 9426 + } + } + } + ], "smithy.api#http": { "method": "GET", "uri": "/2016-08-19/account-settings", @@ -4928,6 +5183,23 @@ ], "traits": { "smithy.api#documentation": "

Returns details about a Lambda function alias.

", + "smithy.api#examples": [ + { + "title": "To get a Lambda function alias", + "documentation": "The following example returns details about an alias named BLUE for a function named my-function", + "input": { + "FunctionName": "my-function", + "Name": "BLUE" + }, + "output": { + "AliasArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function:BLUE", + "Name": "BLUE", + "FunctionVersion": "3", + "RevisionId": "594f41fb-xmpl-4c20-95c7-6ca5f2a92c93", + "Description": "Production environment BLUE." + } + } + ], "smithy.api#http": { "method": "GET", "uri": "/2015-03-31/functions/{FunctionName}/aliases/{Name}", @@ -5089,6 +5361,52 @@ ], "traits": { "smithy.api#documentation": "

Returns information about the function or function version, with a link to download the deployment package\n that's valid for 10 minutes. If you specify a function version, only details that are specific to that version are\n returned.

", + "smithy.api#examples": [ + { + "title": "To get a Lambda function", + "documentation": "The following example returns code and configuration details for version 1 of a function named my-function.", + "input": { + "FunctionName": "my-function", + "Qualifier": "1" + }, + "output": { + "Configuration": { + "FunctionName": "my-function", + "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function", + "Runtime": "nodejs12.x", + "Role": "arn:aws:iam::123456789012:role/lambda-role", + "Handler": "index.handler", + "CodeSize": 5797206, + "Description": "Process image objects from Amazon S3.", + "Timeout": 15, + "MemorySize": 256, + "LastModified": "2020-04-10T19:06:32.563+0000", + "CodeSha256": "YFgDgEKG3ugvF1+pX64gV6tu9qNuIYNUdgJm8nCxsm4=", + "Version": "$LATEST", + "Environment": { + "Variables": { + "PREFIX": "inbound", + "BUCKET": "my-bucket-1xpuxmplzrlbh" + } + }, + "KMSKeyArn": "arn:aws:kms:us-west-2:123456789012:key/b0844d6c-xmpl-4463-97a4-d49f50839966", + "TracingConfig": { + "Mode": "Active" + }, + "RevisionId": "b75dcd81-xmpl-48a8-a75a-93ba8b5b9727", + "State": "Active", + "LastUpdateStatus": "Successful" + }, + "Code": { + "RepositoryType": "S3", + "Location": "https://awslambda-us-west-2-tasks.s3.us-west-2.amazonaws.com/snapshots/123456789012/my-function-e7d9d1ed-xmpl-4f79-904a-4b87f2681f30?versionId=sH3TQwBOaUy..." + }, + "Tags": { + "DEPARTMENT": "Assets" + } + } + } + ], "smithy.api#http": { "method": "GET", "uri": "/2015-03-31/functions/{FunctionName}", @@ -5280,6 +5598,18 @@ ], "traits": { "smithy.api#documentation": "

Returns details about the reserved concurrency configuration for a function. To set a concurrency limit for a\n function, use PutFunctionConcurrency.

", + "smithy.api#examples": [ + { + "title": "To get the reserved concurrency setting for a function", + "documentation": "The following example returns the reserved concurrency setting for a function named my-function.", + "input": { + "FunctionName": "my-function" + }, + "output": { + "ReservedConcurrentExecutions": 250 + } + } + ], "smithy.api#http": { "method": "GET", "uri": "/2019-09-30/functions/{FunctionName}/concurrency", @@ -5341,6 +5671,43 @@ ], "traits": { "smithy.api#documentation": "

Returns the version-specific settings of a Lambda function or version. The output includes only options that\n can vary between versions of a function. To modify these settings, use UpdateFunctionConfiguration.

\n

To get all of a function's details, including function-level settings, use GetFunction.

", + "smithy.api#examples": [ + { + "title": "To get a Lambda function's event source mapping", + "documentation": "The following example returns and configuration details for version 1 of a function named my-function.", + "input": { + "FunctionName": "my-function", + "Qualifier": "1" + }, + "output": { + "FunctionName": "my-function", + "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function", + "Runtime": "nodejs12.x", + "Role": "arn:aws:iam::123456789012:role/lambda-role", + "Handler": "index.handler", + "CodeSize": 5797206, + "Description": "Process image objects from Amazon S3.", + "Timeout": 15, + "MemorySize": 256, + "LastModified": "2020-04-10T19:06:32.563+0000", + "CodeSha256": "YFgDgEKG3ugvF1+pX64gV6tu9qNuIYNUdgJm8nCxsm4=", + "Version": "$LATEST", + "Environment": { + "Variables": { + "PREFIX": "inbound", + "BUCKET": "my-bucket-1xpuxmplzrlbh" + } + }, + "KMSKeyArn": "arn:aws:kms:us-west-2:123456789012:key/b0844d6c-xmpl-4463-97a4-d49f50839966", + "TracingConfig": { + "Mode": "Active" + }, + "RevisionId": "b75dcd81-xmpl-48a8-a75a-93ba8b5b9727", + "State": "Active", + "LastUpdateStatus": "Successful" + } + } + ], "smithy.api#http": { "method": "GET", "uri": "/2015-03-31/functions/{FunctionName}/configuration", @@ -5784,6 +6151,30 @@ ], "traits": { "smithy.api#documentation": "

Returns information about a version of an Lambda\n layer, with a link to download the layer archive\n that's valid for 10 minutes.

", + "smithy.api#examples": [ + { + "title": "To get information about a Lambda layer version", + "documentation": "The following example returns information for version 1 of a layer named my-layer.", + "input": { + "LayerName": "my-layer", + "VersionNumber": 1 + }, + "output": { + "Content": { + "Location": "https://awslambda-us-east-2-layers.s3.us-east-2.amazonaws.com/snapshots/123456789012/my-layer-4aaa2fbb-ff77-4b0a-ad92-5b78a716a96a?versionId=27iWyA73cCAYqyH...", + "CodeSha256": "tv9jJO+rPbXUUXuRKi7CwHzKtLDkDRJLB3cC3Z/ouXo=", + "CodeSize": 169 + }, + "LayerArn": "arn:aws:lambda:us-east-2:123456789012:layer:my-layer", + "LayerVersionArn": "arn:aws:lambda:us-east-2:123456789012:layer:my-layer:1", + "Description": "My Python layer", + "CreatedDate": "2018-11-14T23:03:52.894+0000", + "Version": 1, + "LicenseInfo": "MIT", + "CompatibleRuntimes": ["python3.6", "python3.7"] + } + } + ], "smithy.api#http": { "method": "GET", "uri": "/2018-10-31/layers/{LayerName}/versions/{VersionNumber}", @@ -5815,6 +6206,28 @@ ], "traits": { "smithy.api#documentation": "

Returns information about a version of an Lambda\n layer, with a link to download the layer archive\n that's valid for 10 minutes.

", + "smithy.api#examples": [ + { + "title": "To get information about a Lambda layer version", + "documentation": "The following example returns information about the layer version with the specified Amazon Resource Name (ARN).", + "input": { + "Arn": "arn:aws:lambda:ca-central-1:123456789012:layer:blank-python-lib:3" + }, + "output": { + "Content": { + "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...", + "CodeSha256": "6x+xmpl/M3BnQUk7gS9sGmfeFsR/npojXoA3fZUv4eU=", + "CodeSize": 9529009 + }, + "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", + "Description": "Dependencies for the blank-python sample app.", + "CreatedDate": "2020-03-31T00:35:18.949+0000", + "Version": 3, + "CompatibleRuntimes": ["python3.8"] + } + } + ], "smithy.api#http": { "method": "GET", "uri": "/2018-10-31/layers?find=LayerVersion", @@ -6023,6 +6436,20 @@ ], "traits": { "smithy.api#documentation": "

Returns the resource-based IAM policy for a function, version, or alias.

", + "smithy.api#examples": [ + { + "title": "To retrieve a Lambda function policy", + "documentation": "The following example returns the resource-based policy for version 1 of a Lambda function named my-function.", + "input": { + "FunctionName": "my-function", + "Qualifier": "1" + }, + "output": { + "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" + } + } + ], "smithy.api#http": { "method": "GET", "uri": "/2015-03-31/functions/{FunctionName}/policy", @@ -6100,6 +6527,38 @@ ], "traits": { "smithy.api#documentation": "

Retrieves the provisioned concurrency configuration for a function's alias or version.

", + "smithy.api#examples": [ + { + "title": "To get a provisioned concurrency configuration", + "documentation": "The following example returns details for the provisioned concurrency configuration for the BLUE alias of the specified function.", + "input": { + "FunctionName": "my-function", + "Qualifier": "BLUE" + }, + "output": { + "RequestedProvisionedConcurrentExecutions": 100, + "AvailableProvisionedConcurrentExecutions": 100, + "AllocatedProvisionedConcurrentExecutions": 100, + "Status": "READY", + "LastModified": "2019-12-31T20:28:49+0000" + } + }, + { + "title": "To view a provisioned concurrency configuration", + "documentation": "The following example displays details for the provisioned concurrency configuration for the BLUE alias of the specified function.", + "input": { + "FunctionName": "my-function", + "Qualifier": "BLUE" + }, + "output": { + "RequestedProvisionedConcurrentExecutions": 100, + "AvailableProvisionedConcurrentExecutions": 100, + "AllocatedProvisionedConcurrentExecutions": 100, + "Status": "READY", + "LastModified": "2019-12-31T20:28:49+0000" + } + } + ], "smithy.api#http": { "method": "GET", "uri": "/2019-09-30/functions/{FunctionName}/provisioned-concurrency", @@ -6198,7 +6657,7 @@ } ], "traits": { - "smithy.api#documentation": "

Retrieve the public-access settings for a function.

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

The option to configure public-access settings, and to use the PutPublicAccessBlock and GetPublicAccessBlock APIs, won't be \n available in all Amazon Web Services Regions until September 30, 2024.

\n
\n

Retrieve the public-access settings for a function.

", "smithy.api#http": { "method": "GET", "uri": "/2024-09-16/public-access-block/{ResourceArn}", @@ -6259,7 +6718,7 @@ } ], "traits": { - "smithy.api#documentation": "

Retrieves the resource-based policy attached to a function.

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

The option to create and modify full JSON resource-based policies, and to use the PutResourcePolicy, GetResourcePolicy, and DeleteResourcePolicy APIs, won't be \n available in all Amazon Web Services Regions until September 30, 2024.

\n
\n

Retrieves the resource-based policy attached to a function.

", "smithy.api#http": { "method": "GET", "uri": "/2024-09-16/resource-policy/{ResourceArn}", @@ -6837,6 +7296,35 @@ ], "traits": { "smithy.api#documentation": "

Invokes a Lambda function. You can invoke a function synchronously (and wait for the response), or\n asynchronously. By default, Lambda invokes your function synchronously (i.e. theInvocationType\n is RequestResponse). To invoke a function asynchronously, set InvocationType to\n Event. Lambda passes the ClientContext object to your function for\n synchronous invocations only.

\n

For synchronous invocation,\n details about the function response, including errors, are included in the response body and headers. For either\n invocation type, you can find more information in the execution log and trace.

\n

When an error occurs, your function may be invoked multiple times. Retry behavior varies by error type,\n client, event source, and invocation type. For example, if you invoke a function asynchronously and it returns an\n error, Lambda executes the function up to two more times. For more information, see Error handling and automatic retries in\n Lambda.

\n

For asynchronous invocation,\n Lambda adds events to a queue before sending them to your function. If your function does not have enough capacity\n to keep up with the queue, events may be lost. Occasionally, your function may receive the same event multiple\n times, even if no error occurs. To retain events that were not processed, configure your function with a dead-letter queue.

\n

The status code in the API response doesn't reflect function errors. Error codes are reserved for errors that\n prevent your function from executing, such as permissions errors, quota errors, or issues with your function's code and\n configuration. For example, Lambda returns TooManyRequestsException if running the\n function would cause you to exceed a concurrency limit at either the account level\n (ConcurrentInvocationLimitExceeded) or function level\n (ReservedFunctionConcurrentInvocationLimitExceeded).

\n

For functions with a long timeout, your client might disconnect during synchronous invocation while it waits\n for a response. Configure your HTTP client, SDK, firewall, proxy, or operating system to allow for long\n connections with timeout or keep-alive settings.

\n

This operation requires permission for the lambda:InvokeFunction action. For details on how to set up\n permissions for cross-account invocations, see Granting function\n access to other accounts.

", + "smithy.api#examples": [ + { + "title": "To invoke a Lambda function", + "documentation": "The following example invokes version 1 of a function named my-function with an empty event payload.", + "input": { + "FunctionName": "my-function", + "Payload": "{}", + "Qualifier": "1" + }, + "output": { + "StatusCode": 200, + "Payload": "200 SUCCESS" + } + }, + { + "title": "To invoke a Lambda function asynchronously", + "documentation": "The following example invokes version 1 of a function named my-function asynchronously.", + "input": { + "FunctionName": "my-function", + "Payload": "{}", + "InvocationType": "Event", + "Qualifier": "1" + }, + "output": { + "StatusCode": 202, + "Payload": "" + } + } + ], "smithy.api#http": { "method": "POST", "uri": "/2015-03-31/functions/{FunctionName}/invocations", @@ -6872,6 +7360,19 @@ "traits": { "smithy.api#deprecated": {}, "smithy.api#documentation": "\n

For asynchronous function invocation, use Invoke.

\n
\n

Invokes a function asynchronously.

\n \n

If you do use the InvokeAsync action, note that it doesn't support the use of X-Ray active tracing. Trace ID is not \n propagated to the function, even if X-Ray active tracing is turned on.

\n
", + "smithy.api#examples": [ + { + "title": "To invoke a Lambda function asynchronously", + "documentation": "The following example invokes a Lambda function asynchronously", + "input": { + "FunctionName": "my-function", + "InvokeArgs": "{}" + }, + "output": { + "Status": 202 + } + } + ], "smithy.api#http": { "method": "POST", "uri": "/2014-11-13/functions/{FunctionName}/invoke-async", @@ -7715,6 +8216,38 @@ ], "traits": { "smithy.api#documentation": "

Returns a list of aliases\n for a Lambda function.

", + "smithy.api#examples": [ + { + "title": "To list a function's aliases", + "documentation": "The following example returns a list of aliases for a function named my-function.", + "input": { + "FunctionName": "my-function" + }, + "output": { + "Aliases": [ + { + "AliasArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function:BETA", + "RevisionId": "a410117f-xmpl-494e-8035-7e204bb7933b", + "FunctionVersion": "2", + "Name": "BLUE", + "Description": "Production environment BLUE.", + "RoutingConfig": { + "AdditionalVersionWeights": { + "1": 0.7 + } + } + }, + { + "AliasArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function:LIVE", + "RevisionId": "21d40116-xmpl-40ba-9360-3ea284da1bb5", + "FunctionVersion": "1", + "Name": "GREEN", + "Description": "Production environment GREEN." + } + ] + } + } + ], "smithy.api#http": { "method": "GET", "uri": "/2015-03-31/functions/{FunctionName}/aliases", @@ -7882,6 +8415,28 @@ ], "traits": { "smithy.api#documentation": "

Lists event source mappings. Specify an EventSourceArn to show only event source mappings for a\n single event source.

", + "smithy.api#examples": [ + { + "title": "To list the event source mappings for a function", + "documentation": "The following example returns a list of the event source mappings for a function named my-function.", + "input": { + "FunctionName": "my-function" + }, + "output": { + "EventSourceMappings": [ + { + "UUID": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE", + "StateTransitionReason": "USER_INITIATED", + "LastModified": 1.569284520333e9, + "BatchSize": 5, + "State": "Enabled", + "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function", + "EventSourceArn": "arn:aws:sqs:us-west-2:123456789012:mySQSqueue" + } + ] + } + } + ], "smithy.api#http": { "method": "GET", "uri": "/2015-03-31/event-source-mappings", @@ -7975,6 +8530,31 @@ ], "traits": { "smithy.api#documentation": "

Retrieves a list of configurations for asynchronous invocation for a function.

\n

To configure options for asynchronous invocation, use PutFunctionEventInvokeConfig.

", + "smithy.api#examples": [ + { + "title": "To view a list of asynchronous invocation configurations", + "documentation": "The following example returns a list of asynchronous invocation configurations for a function named my-function.", + "input": { + "FunctionName": "my-function" + }, + "output": { + "FunctionEventInvokeConfigs": [ + { + "LastModified": 1.577824406719e9, + "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function:GREEN", + "MaximumRetryAttempts": 2, + "MaximumEventAgeInSeconds": 1800 + }, + { + "LastModified": 1.577824396653e9, + "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function:BLUE", + "MaximumRetryAttempts": 0, + "MaximumEventAgeInSeconds": 3600 + } + ] + } + } + ], "smithy.api#http": { "method": "GET", "uri": "/2019-09-25/functions/{FunctionName}/event-invoke-config/list", @@ -8147,6 +8727,58 @@ ], "traits": { "smithy.api#documentation": "

Returns a list of Lambda functions, with the version-specific configuration of each. Lambda returns up to 50\n functions per call.

\n

Set FunctionVersion to ALL to include all published versions of each function in\n addition to the unpublished version.

\n \n

The ListFunctions operation returns a subset of the FunctionConfiguration fields.\n To get the additional fields (State, StateReasonCode, StateReason, LastUpdateStatus, LastUpdateStatusReason,\n LastUpdateStatusReasonCode, RuntimeVersionConfig) for a function or version, use GetFunction.

\n
", + "smithy.api#examples": [ + { + "title": "To get a list of Lambda functions", + "documentation": "This operation returns a list of Lambda functions.", + "output": { + "NextMarker": "", + "Functions": [ + { + "TracingConfig": { + "Mode": "PassThrough" + }, + "Version": "$LATEST", + "CodeSha256": "dBG9m8SGdmlEjw/JYXlhhvCrAv5TxvXsbL/RMr0fT/I=", + "FunctionName": "helloworld", + "MemorySize": 128, + "RevisionId": "1718e831-badf-4253-9518-d0644210af7b", + "CodeSize": 294, + "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:helloworld", + "Handler": "helloworld.handler", + "Role": "arn:aws:iam::123456789012:role/service-role/MyTestFunction-role-zgur6bf4", + "Timeout": 3, + "LastModified": "2019-09-23T18:32:33.857+0000", + "Runtime": "nodejs10.x", + "Description": "" + }, + { + "TracingConfig": { + "Mode": "PassThrough" + }, + "Version": "$LATEST", + "CodeSha256": "sU0cJ2/hOZevwV/lTxCuQqK3gDZP3i8gUoqUUVRmY6E=", + "FunctionName": "my-function", + "VpcConfig": { + "SubnetIds": [], + "VpcId": "", + "SecurityGroupIds": [] + }, + "MemorySize": 256, + "RevisionId": "93017fc9-59cb-41dc-901b-4845ce4bf668", + "CodeSize": 266, + "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function", + "Handler": "index.handler", + "Role": "arn:aws:iam::123456789012:role/service-role/helloWorldPython-role-uy3l9qyq", + "Timeout": 3, + "LastModified": "2019-10-01T16:47:28.490+0000", + "Runtime": "nodejs10.x", + "Description": "" + } + ] + } + } + ], "smithy.api#http": { "method": "GET", "uri": "/2015-03-31/functions", @@ -8325,6 +8957,33 @@ ], "traits": { "smithy.api#documentation": "

Lists the versions of an Lambda\n layer. Versions that have been deleted aren't listed. Specify a runtime identifier to list only\n versions that indicate that they're compatible with that runtime. Specify a compatible architecture to include only \n layer versions that are compatible with that architecture.

", + "smithy.api#examples": [ + { + "title": "To list versions of a layer", + "documentation": "The following example displays information about the versions for the layer named blank-java-lib", + "input": { + "LayerName": "blank-java-lib" + }, + "output": { + "LayerVersions": [ + { + "LayerVersionArn": "arn:aws:lambda:us-east-2:123456789012:layer:blank-java-lib:7", + "Version": 7, + "Description": "Dependencies for the blank-java sample app.", + "CreatedDate": "2020-03-18T23:38:42.284+0000", + "CompatibleRuntimes": ["java8"] + }, + { + "LayerVersionArn": "arn:aws:lambda:us-east-2:123456789012:layer:blank-java-lib:6", + "Version": 6, + "Description": "Dependencies for the blank-java sample app.", + "CreatedDate": "2020-03-17T07:24:21.960+0000", + "CompatibleRuntimes": ["java8"] + } + ] + } + } + ], "smithy.api#http": { "method": "GET", "uri": "/2018-10-31/layers/{LayerName}/versions", @@ -8423,6 +9082,30 @@ ], "traits": { "smithy.api#documentation": "

Lists Lambda\n layers and shows information about the latest version of each. Specify a\n runtime\n identifier to list only layers that indicate that they're compatible with that\n runtime. Specify a compatible architecture to include only layers that are compatible with\n that instruction set architecture.

", + "smithy.api#examples": [ + { + "title": "To list the layers that are compatible with your function's runtime", + "documentation": "The following example returns information about layers that are compatible with the Python 3.7 runtime.", + "input": { + "CompatibleRuntime": "python3.7" + }, + "output": { + "Layers": [ + { + "LayerName": "my-layer", + "LayerArn": "arn:aws:lambda:us-east-2:123456789012:layer:my-layer", + "LatestMatchingVersion": { + "LayerVersionArn": "arn:aws:lambda:us-east-2:123456789012:layer:my-layer:2", + "Version": 2, + "Description": "My layer", + "CreatedDate": "2018-11-15T00:37:46.592+0000", + "CompatibleRuntimes": ["python3.6", "python3.7"] + } + } + ] + } + } + ], "smithy.api#http": { "method": "GET", "uri": "/2018-10-31/layers", @@ -8516,6 +9199,35 @@ ], "traits": { "smithy.api#documentation": "

Retrieves a list of provisioned concurrency configurations for a function.

", + "smithy.api#examples": [ + { + "title": "To get a list of provisioned concurrency configurations", + "documentation": "The following example returns a list of provisioned concurrency configurations for a function named my-function.", + "input": { + "FunctionName": "my-function" + }, + "output": { + "ProvisionedConcurrencyConfigs": [ + { + "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function:GREEN", + "RequestedProvisionedConcurrentExecutions": 100, + "AvailableProvisionedConcurrentExecutions": 100, + "AllocatedProvisionedConcurrentExecutions": 100, + "Status": "READY", + "LastModified": "2019-12-31T20:29:00+0000" + }, + { + "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function:BLUE", + "RequestedProvisionedConcurrentExecutions": 100, + "AvailableProvisionedConcurrentExecutions": 100, + "AllocatedProvisionedConcurrentExecutions": 100, + "Status": "READY", + "LastModified": "2019-12-31T20:28:49+0000" + } + ] + } + } + ], "smithy.api#http": { "method": "GET", "uri": "/2019-09-30/functions/{FunctionName}/provisioned-concurrency?List=ALL", @@ -8602,7 +9314,22 @@ } ], "traits": { - "smithy.api#documentation": "

Returns a function's tags. You can\n also view tags with GetFunction.

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

Returns a function, event source mapping, or code signing configuration's tags. You can\n also view funciton tags with GetFunction.

", + "smithy.api#examples": [ + { + "title": "To retrieve the list of tags for a Lambda function", + "documentation": "The following example displays the tags attached to the my-function Lambda function.", + "input": { + "Resource": "arn:aws:lambda:us-west-2:123456789012:function:my-function" + }, + "output": { + "Tags": { + "Category": "Web Tools", + "Department": "Sales" + } + } + } + ], "smithy.api#http": { "method": "GET", "uri": "/2017-03-31/tags/{Resource}", @@ -8614,9 +9341,9 @@ "type": "structure", "members": { "Resource": { - "target": "com.amazonaws.lambda#FunctionArn", + "target": "com.amazonaws.lambda#TaggableResource", "traits": { - "smithy.api#documentation": "

The function's Amazon Resource Name (ARN). \n Note: Lambda does not support adding tags to aliases or versions.

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

The resource's Amazon Resource Name (ARN). \n Note: Lambda does not support adding tags to function aliases or versions.

", "smithy.api#httpLabel": {}, "smithy.api#required": {} } @@ -8664,6 +9391,69 @@ ], "traits": { "smithy.api#documentation": "

Returns a list of versions,\n with the version-specific configuration of each. Lambda returns up to 50 versions per call.

", + "smithy.api#examples": [ + { + "title": "To list versions of a function", + "documentation": "The following example returns a list of versions of a function named my-function", + "input": { + "FunctionName": "my-function" + }, + "output": { + "Versions": [ + { + "FunctionName": "my-function", + "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function", + "Runtime": "nodejs12.x", + "Role": "arn:aws:iam::123456789012:role/lambda-role", + "Handler": "index.handler", + "CodeSize": 5797206, + "Description": "Process image objects from Amazon S3.", + "Timeout": 15, + "MemorySize": 256, + "LastModified": "2020-04-10T19:06:32.563+0000", + "CodeSha256": "YFgDgEKG3ugvF1+pX64gV6tu9qNuIYNUdgJm8nCxsm4=", + "Version": "$LATEST", + "Environment": { + "Variables": { + "PREFIX": "inbound", + "BUCKET": "my-bucket-1xpuxmplzrlbh" + } + }, + "KMSKeyArn": "arn:aws:kms:us-west-2:123456789012:key/b0844d6c-xmpl-4463-97a4-d49f50839966", + "TracingConfig": { + "Mode": "Active" + }, + "RevisionId": "850ca006-2d98-4ff4-86db-8766e9d32fe9" + }, + { + "FunctionName": "my-function", + "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function", + "Runtime": "nodejs12.x", + "Role": "arn:aws:iam::123456789012:role/lambda-role", + "Handler": "index.handler", + "CodeSize": 5797206, + "Description": "Process image objects from Amazon S3.", + "Timeout": 5, + "MemorySize": 256, + "LastModified": "2020-04-10T19:06:32.563+0000", + "CodeSha256": "YFgDgEKG3ugvF1+pX64gV6tu9qNuIYNUdgJm8nCxsm4=", + "Version": "1", + "Environment": { + "Variables": { + "PREFIX": "inbound", + "BUCKET": "my-bucket-1xpuxmplzrlbh" + } + }, + "KMSKeyArn": "arn:aws:kms:us-west-2:123456789012:key/b0844d6c-xmpl-4463-97a4-d49f50839966", + "TracingConfig": { + "Mode": "Active" + }, + "RevisionId": "b75dcd81-xmpl-48a8-a75a-93ba8b5b9727" + } + ] + } + } + ], "smithy.api#http": { "method": "GET", "uri": "/2015-03-31/functions/{FunctionName}/versions", @@ -9316,6 +10106,36 @@ ], "traits": { "smithy.api#documentation": "

Creates an Lambda\n layer from a ZIP archive. Each time you call PublishLayerVersion with the same\n layer name, a new version is created.

\n

Add layers to your function with CreateFunction or UpdateFunctionConfiguration.

", + "smithy.api#examples": [ + { + "title": "To create a Lambda layer version", + "documentation": "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.", + "input": { + "LayerName": "my-layer", + "Description": "My Python layer", + "Content": { + "S3Bucket": "lambda-layers-us-west-2-123456789012", + "S3Key": "layer.zip" + }, + "CompatibleRuntimes": ["python3.6", "python3.7"], + "LicenseInfo": "MIT" + }, + "output": { + "Content": { + "Location": "https://awslambda-us-west-2-layers.s3.us-west-2.amazonaws.com/snapshots/123456789012/my-layer-4aaa2fbb-ff77-4b0a-ad92-5b78a716a96a?versionId=27iWyA73cCAYqyH...", + "CodeSha256": "tv9jJO+rPbXUUXuRKi7CwHzKtLDkDRJLB3cC3Z/ouXo=", + "CodeSize": 169 + }, + "LayerArn": "arn:aws:lambda:us-west-2:123456789012:layer:my-layer", + "LayerVersionArn": "arn:aws:lambda:us-west-2:123456789012:layer:my-layer:1", + "Description": "My Python layer", + "CreatedDate": "2018-11-14T23:03:52.894+0000", + "Version": 1, + "LicenseInfo": "MIT", + "CompatibleRuntimes": ["python3.6", "python3.7"] + } + } + ], "smithy.api#http": { "method": "POST", "uri": "/2018-10-31/layers/{LayerName}/versions", @@ -9466,6 +10286,44 @@ ], "traits": { "smithy.api#documentation": "

Creates a version from the\n current code and configuration of a function. Use versions to create a snapshot of your function code and\n configuration that doesn't change.

\n

Lambda doesn't publish a version if the function's configuration and code haven't changed since the last\n version. Use UpdateFunctionCode or UpdateFunctionConfiguration to update the\n function before publishing a version.

\n

Clients can invoke versions directly or with an alias. To create an alias, use CreateAlias.

", + "smithy.api#examples": [ + { + "title": "To publish a version of a Lambda function", + "documentation": "This operation publishes a version of a Lambda function", + "input": { + "FunctionName": "myFunction", + "CodeSha256": "", + "Description": "" + }, + "output": { + "FunctionName": "my-function", + "FunctionArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function", + "Runtime": "nodejs12.x", + "Role": "arn:aws:iam::123456789012:role/lambda-role", + "Handler": "index.handler", + "CodeSize": 5797206, + "Description": "Process image objects from Amazon S3.", + "Timeout": 5, + "MemorySize": 256, + "LastModified": "2020-04-10T19:06:32.563+0000", + "CodeSha256": "YFgDgEKG3ugvF1+pX64gV6tu9qNuIYNUdgJm8nCxsm4=", + "Version": "1", + "Environment": { + "Variables": { + "PREFIX": "inbound", + "BUCKET": "my-bucket-1xpuxmplzrlbh" + } + }, + "KMSKeyArn": "arn:aws:kms:us-west-2:123456789012:key/b0844d6c-xmpl-4463-97a4-d49f50839966", + "TracingConfig": { + "Mode": "Active" + }, + "RevisionId": "b75dcd81-xmpl-48a8-a75a-93ba8b5b9727", + "State": "Active", + "LastUpdateStatus": "Successful" + } + } + ], "smithy.api#http": { "method": "POST", "uri": "/2015-03-31/functions/{FunctionName}/versions", @@ -9616,6 +10474,19 @@ ], "traits": { "smithy.api#documentation": "

Sets the maximum number of simultaneous executions for a function, and reserves capacity for that concurrency\n level.

\n

Concurrency settings apply to the function as a whole, including all published versions and the unpublished\n version. Reserving concurrency both ensures that your function has capacity to process the specified number of\n events simultaneously, and prevents it from scaling beyond that level. Use GetFunction to see\n the current setting for a function.

\n

Use GetAccountSettings to see your Regional concurrency limit. You can reserve concurrency\n for as many functions as you like, as long as you leave at least 100 simultaneous executions unreserved for\n functions that aren't configured with a per-function limit. For more information, see Lambda function scaling.

", + "smithy.api#examples": [ + { + "title": "To configure a reserved concurrency limit for a function", + "documentation": "The following example configures 100 reserved concurrent executions for the my-function function.", + "input": { + "FunctionName": "my-function", + "ReservedConcurrentExecutions": 100 + }, + "output": { + "ReservedConcurrentExecutions": 100 + } + } + ], "smithy.api#http": { "method": "PUT", "uri": "/2017-10-31/functions/{FunctionName}/concurrency", @@ -9819,6 +10690,23 @@ ], "traits": { "smithy.api#documentation": "

Adds a provisioned concurrency configuration to a function's alias or version.

", + "smithy.api#examples": [ + { + "title": "To allocate provisioned concurrency", + "documentation": "The following example allocates 100 provisioned concurrency for the BLUE alias of the specified function.", + "input": { + "FunctionName": "my-function", + "Qualifier": "BLUE", + "ProvisionedConcurrentExecutions": 100 + }, + "output": { + "RequestedProvisionedConcurrentExecutions": 100, + "AllocatedProvisionedConcurrentExecutions": 0, + "Status": "IN_PROGRESS", + "LastModified": "2019-11-21T19:32:12+0000" + } + } + ], "smithy.api#http": { "method": "PUT", "uri": "/2019-09-30/functions/{FunctionName}/provisioned-concurrency", @@ -9927,7 +10815,7 @@ } ], "traits": { - "smithy.api#documentation": "

Configure your function's public-access settings.

\n

To control public access to a Lambda function, you can choose whether to allow the creation of \n resource-based policies that \n allow public access to that function. You can also block public access to a function, even if it has an existing resource-based \n policy that allows it.

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

The option to configure public-access settings, and to use the PutPublicAccessBlock and GetPublicAccessBlock APIs, won't be \n available in all Amazon Web Services Regions until September 30, 2024.

\n
\n

Configure your function's public-access settings.

\n

To control public access to a Lambda function, you can choose whether to allow the creation of \n resource-based policies that \n allow public access to that function. You can also block public access to a function, even if it has an existing resource-based \n policy that allows it.

", "smithy.api#http": { "method": "PUT", "uri": "/2024-09-16/public-access-block/{ResourceArn}", @@ -10007,7 +10895,7 @@ } ], "traits": { - "smithy.api#documentation": "

Adds a resource-based policy \n to a function. You can use resource-based policies to grant access to other \n Amazon Web Services accounts, \n organizations, or \n services. Resource-based policies \n apply to a single function, version, or alias.

\n \n

Adding a resource-based policy using this API action replaces any existing policy you've previously created. This means that if \n you've previously added resource-based permissions to a function using the AddPermission action, those \n permissions will be overwritten by your new policy.

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

The option to create and modify full JSON resource-based policies, and to use the PutResourcePolicy, GetResourcePolicy, and DeleteResourcePolicy APIs, won't be \n available in all Amazon Web Services Regions until September 30, 2024.

\n
\n

Adds a resource-based policy \n to a function. You can use resource-based policies to grant access to other \n Amazon Web Services accounts, \n organizations, or \n services. Resource-based policies \n apply to a single function, version, or alias.

\n \n

Adding a resource-based policy using this API action replaces any existing policy you've previously created. This means that if \n you've previously added resource-based permissions to a function using the AddPermission action, those \n permissions will be overwritten by your new policy.

\n
", "smithy.api#http": { "method": "PUT", "uri": "/2024-09-16/resource-policy/{ResourceArn}", @@ -10260,6 +11148,17 @@ ], "traits": { "smithy.api#documentation": "

Removes a statement from the permissions policy for a version of an Lambda\n layer. For more information, see\n AddLayerVersionPermission.

", + "smithy.api#examples": [ + { + "title": "To delete layer-version permissions", + "documentation": "The following example deletes permission for an account to configure a layer version.", + "input": { + "LayerName": "my-layer", + "VersionNumber": 1, + "StatementId": "xaccount" + } + } + ], "smithy.api#http": { "method": "DELETE", "uri": "/2018-10-31/layers/{LayerName}/versions/{VersionNumber}/policy/{StatementId}", @@ -10322,6 +11221,9 @@ { "target": "com.amazonaws.lambda#PreconditionFailedException" }, + { + "target": "com.amazonaws.lambda#PublicPolicyException" + }, { "target": "com.amazonaws.lambda#ResourceNotFoundException" }, @@ -10334,6 +11236,17 @@ ], "traits": { "smithy.api#documentation": "

Revokes function-use permission from an Amazon Web Servicesservice or another Amazon Web Services account. You\n can get the ID of the statement from the output of GetPolicy.

", + "smithy.api#examples": [ + { + "title": "To remove a Lambda function's permissions", + "documentation": "The following example removes a permissions statement named xaccount from the PROD alias of a function named my-function.", + "input": { + "FunctionName": "my-function", + "StatementId": "xaccount", + "Qualifier": "PROD" + } + } + ], "smithy.api#http": { "method": "DELETE", "uri": "/2015-03-31/functions/{FunctionName}/policy/{StatementId}", @@ -11436,7 +12349,19 @@ } ], "traits": { - "smithy.api#documentation": "

Adds tags to a function.

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

Adds tags to a function, event source mapping, or code signing configuration.

", + "smithy.api#examples": [ + { + "title": "To add tags to an existing Lambda function", + "documentation": "The following example adds a tag with the key name DEPARTMENT and a value of 'Department A' to the specified Lambda function.", + "input": { + "Resource": "arn:aws:lambda:us-west-2:123456789012:function:my-function", + "Tags": { + "DEPARTMENT": "Department A" + } + } + } + ], "smithy.api#http": { "method": "POST", "uri": "/2017-03-31/tags/{Resource}", @@ -11448,9 +12373,9 @@ "type": "structure", "members": { "Resource": { - "target": "com.amazonaws.lambda#FunctionArn", + "target": "com.amazonaws.lambda#TaggableResource", "traits": { - "smithy.api#documentation": "

The function's Amazon Resource Name (ARN).

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

The resource's Amazon Resource Name (ARN).

", "smithy.api#httpLabel": {}, "smithy.api#required": {} } @@ -11458,7 +12383,7 @@ "Tags": { "target": "com.amazonaws.lambda#Tags", "traits": { - "smithy.api#documentation": "

A list of tags to apply to the function.

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

A list of tags to apply to the resource.

", "smithy.api#required": {} } } @@ -11470,6 +12395,16 @@ "com.amazonaws.lambda#TagValue": { "type": "string" }, + "com.amazonaws.lambda#TaggableResource": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 256 + }, + "smithy.api#pattern": "^arn:(aws[a-zA-Z-]*):lambda:[a-z]{2}((-gov)|(-iso([a-z]?)))?-[a-z]+-\\d{1}:\\d{12}:(function:[a-zA-Z0-9-_]+(:(\\$LATEST|[a-zA-Z0-9-_]+))?|code-signing-config:csc-[a-z0-9]{17}|event-source-mapping:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$" + } + }, "com.amazonaws.lambda#Tags": { "type": "map", "key": { @@ -11703,7 +12638,17 @@ } ], "traits": { - "smithy.api#documentation": "

Removes tags from a function.

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

Removes tags from a function, event source mapping, or code signing configuration.

", + "smithy.api#examples": [ + { + "title": "To remove tags from an existing Lambda function", + "documentation": "The following example removes the tag with the key name DEPARTMENT tag from the my-function Lambda function.", + "input": { + "Resource": "arn:aws:lambda:us-west-2:123456789012:function:my-function", + "TagKeys": ["DEPARTMENT"] + } + } + ], "smithy.api#http": { "method": "DELETE", "uri": "/2017-03-31/tags/{Resource}", @@ -11715,9 +12660,9 @@ "type": "structure", "members": { "Resource": { - "target": "com.amazonaws.lambda#FunctionArn", + "target": "com.amazonaws.lambda#TaggableResource", "traits": { - "smithy.api#documentation": "

The function's Amazon Resource Name (ARN).

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

The resource's Amazon Resource Name (ARN).

", "smithy.api#httpLabel": {}, "smithy.api#required": {} } @@ -11725,7 +12670,7 @@ "TagKeys": { "target": "com.amazonaws.lambda#TagKeyList", "traits": { - "smithy.api#documentation": "

A list of tag keys to remove from the function.

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

A list of tag keys to remove from the resource.

", "smithy.api#httpQuery": "tagKeys", "smithy.api#required": {} } @@ -11765,6 +12710,34 @@ ], "traits": { "smithy.api#documentation": "

Updates the configuration of a Lambda function alias.

", + "smithy.api#examples": [ + { + "title": "To update a function alias", + "documentation": "The following example updates the alias named BLUE to send 30% of traffic to version 2 and 70% to version 1.", + "input": { + "FunctionName": "my-function", + "Name": "BLUE", + "FunctionVersion": "2", + "RoutingConfig": { + "AdditionalVersionWeights": { + "1": 0.7 + } + } + }, + "output": { + "FunctionVersion": "2", + "Name": "BLUE", + "AliasArn": "arn:aws:lambda:us-west-2:123456789012:function:my-function:BLUE", + "RevisionId": "594f41fb-xmpl-4c20-95c7-6ca5f2a92c93", + "Description": "Production environment BLUE.", + "RoutingConfig": { + "AdditionalVersionWeights": { + "1": 0.7 + } + } + } + } + ], "smithy.api#http": { "method": "PUT", "uri": "/2015-03-31/functions/{FunctionName}/aliases/{Name}", @@ -12088,6 +13061,35 @@ ], "traits": { "smithy.api#documentation": "

Updates a Lambda function's code. If code signing is enabled for the function, the code package\n must be signed by a trusted publisher. For more information, see Configuring code signing for Lambda.

\n

If the function's package type is Image, then you must specify the code package in\n ImageUri as the URI of a container image in the Amazon ECR registry.

\n

If the function's package type is Zip, then you must specify the deployment package as a .zip file\n archive. Enter the Amazon S3 bucket and key of the code .zip file location. You can also provide\n the function code inline using the ZipFile field.

\n

The code in the deployment package must be compatible with the target instruction set architecture of the\n function (x86-64 or arm64).

\n

The function's code is locked when you publish a version. You can't modify the code of a published version,\n only the unpublished version.

\n \n

For a function defined as a container image, Lambda resolves the image tag to an image digest. In\n Amazon ECR, if you update the image tag to a new image, Lambda does not automatically\n update the function.

\n
", + "smithy.api#examples": [ + { + "title": "To update a Lambda function's code", + "documentation": "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.", + "input": { + "FunctionName": "my-function", + "S3Bucket": "my-bucket-1xpuxmplzrlbh", + "S3Key": "function.zip" + }, + "output": { + "TracingConfig": { + "Mode": "PassThrough" + }, + "CodeSha256": "PFn4S+er27qk+UuZSTKEQfNKG/XNn7QJs90mJgq6oH8=", + "FunctionName": "my-function", + "CodeSize": 308, + "RevisionId": "873282ed-xmpl-4dc8-a069-d0c647e470c6", + "MemorySize": 128, + "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", + "Version": "$LATEST", + "Role": "arn:aws:iam::123456789012:role/lambda-role", + "Timeout": 3, + "LastModified": "2019-08-14T22:26:11.234+0000", + "Handler": "index.handler", + "Runtime": "nodejs12.x", + "Description": "" + } + } + ], "smithy.api#http": { "method": "PUT", "uri": "/2015-03-31/functions/{FunctionName}/code", @@ -12206,6 +13208,34 @@ ], "traits": { "smithy.api#documentation": "

Modify the version-specific settings of a Lambda function.

\n

When you update a function, Lambda provisions an instance of the function and its supporting\n resources. If your function connects to a VPC, this process can take a minute. During this time, you can't modify\n the function, but you can still invoke it. The LastUpdateStatus, LastUpdateStatusReason,\n and LastUpdateStatusReasonCode fields in the response from GetFunctionConfiguration\n indicate when the update is complete and the function is processing events with the new configuration. For more\n information, see Lambda\n function states.

\n

These settings can vary between versions of a function and are locked when you publish a version. You can't\n modify the configuration of a published version, only the unpublished version.

\n

To configure function concurrency, use PutFunctionConcurrency. To grant invoke permissions\n to an Amazon Web Services account or Amazon Web Servicesservice, use AddPermission.

", + "smithy.api#examples": [ + { + "title": "To update a Lambda function's configuration", + "documentation": "The following example modifies the memory size to be 256 MB for the unpublished ($LATEST) version of a function named my-function.", + "input": { + "FunctionName": "my-function", + "MemorySize": 256 + }, + "output": { + "TracingConfig": { + "Mode": "PassThrough" + }, + "CodeSha256": "PFn4S+er27qk+UuZSTKEQfNKG/XNn7QJs90mJgq6oH8=", + "FunctionName": "my-function", + "CodeSize": 308, + "RevisionId": "873282ed-xmpl-4dc8-a069-d0c647e470c6", + "MemorySize": 256, + "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function", + "Version": "$LATEST", + "Role": "arn:aws:iam::123456789012:role/lambda-role", + "Timeout": 3, + "LastModified": "2019-08-14T22:26:11.234+0000", + "Handler": "index.handler", + "Runtime": "nodejs12.x", + "Description": "" + } + } + ], "smithy.api#http": { "method": "PUT", "uri": "/2015-03-31/functions/{FunctionName}/configuration", @@ -12364,6 +13394,32 @@ ], "traits": { "smithy.api#documentation": "

Updates the configuration for asynchronous invocation for a function, version, or alias.

\n

To configure options for asynchronous invocation, use PutFunctionEventInvokeConfig.

", + "smithy.api#examples": [ + { + "title": "To update an asynchronous invocation configuration", + "documentation": "The following example adds an on-failure destination to the existing asynchronous invocation configuration for a function named my-function.", + "input": { + "FunctionName": "my-function", + "DestinationConfig": { + "OnFailure": { + "Destination": "arn:aws:sqs:us-east-2:123456789012:destination" + } + } + }, + "output": { + "LastModified": 1.573687896493e9, + "FunctionArn": "arn:aws:lambda:us-east-2:123456789012:function:my-function:$LATEST", + "MaximumRetryAttempts": 0, + "MaximumEventAgeInSeconds": 3600, + "DestinationConfig": { + "OnSuccess": {}, + "OnFailure": { + "Destination": "arn:aws:sqs:us-east-2:123456789012:destination" + } + } + } + } + ], "smithy.api#http": { "method": "POST", "uri": "/2019-09-25/functions/{FunctionName}/event-invoke-config",